19#ifndef _STREAMINTERFACE_H_
20#define _STREAMINTERFACE_H_
24#include <isode/ll/internet.h>
25#include <isode/messages/ioevent.h>
26#include <openssl/x509.h>
57 const struct sockaddr *daddr;
66 const struct sockaddr *laddr;
77 const struct sockaddr *daddr;
108 StreamControlNoDelay,
Class defining an SSL context.
Provider of a stream interface.
virtual void Deliver(StreamControl *option)=0
Control stream.
virtual void Deliver(External *ext)=0
Set external.
virtual void Deliver(DisconnectRequest *req)=0
disconnect
virtual void Deliver(LengthFnxRequest *req)=0
Set length function.
Provider()
The user of this provider.
virtual ~Provider()
Destructor should be virtual.
virtual void Die()=0
Go away.
virtual void Deliver(ReadRequest *req)=0
Release read buffer.
User * GetUser()
get the user
virtual void Deliver(ListenRequest *req)=0
listen
virtual int GetLocalAddress(struct sockaddr *laddr, socklen_t *lalenp, MSGstruct *msp)=0
Get the local address.
virtual void Deliver(ConnectAccept *req)=0
accept
virtual void Deliver(StartTLS *req)=0
Start SSL/TLS on stream.
virtual unsigned Events()=0
Get the poller events on the endpoint.
virtual void Deliver(DataRequest *req)=0
send data
virtual void Deliver(ConnectRequest *req)=0
connect
virtual X509 * GetPeerCertificate()
Return the current TLS client certificate, if any.
virtual int GetPeerAddress(struct sockaddr *paddr, socklen_t *palenp, MSGstruct *msp)=0
Get the local address.
static EVENTSVC_DLL Provider * ProviderFactory(const char *type, MSGstruct *msp)
Factory method for Stream provider.
void SetUser(User *u)
set the user
virtual endpoint_t GetEndpoint(bool inheriting)=0
Get the endpoint ID, if inheriting, set to be inherited.
virtual TLS_CipherSuite GetCipherSuite()
Return the current TLS cipher, if any.
Virtual class defining interface to stream user.
Provider * GetProvider()
Get provider.
virtual ~User()
Destructor should be virtual.
void SetProvider(Provider *p)
Set provider.
User()
The provider used by this User.
virtual void Deliver(ConnectIndication *data)=0
Connection indication.
virtual void Deliver(ReleaseBuf *release)=0
Provider finished with write buffer.
virtual void Deliver(DataIndication *data)=0
Receive data read by provider.
virtual void Deliver(StatusIndication *error)=0
Provider status.
Interface between a user of a stream and the provider of a stream.
StreamControlOption
Control the stream with various options.
@ StreamControlTOS
Keep alive flag.
@ StreamControlKeepAlive
No delay flag.
size_t LengthFnx(const char *buf)
Typedef for datagram length function.
socklen_t dalen
Destination address.
const struct sockaddr * saddr
Pointer to new provider.
Provider * newprovider
Pointer to listening provider.
socklen_t salen
Caller's Source address.
socklen_t lalen
Local address.
const struct sockaddr * laddr
Length of Source address.
unsigned dscp
Length of Source address.
socklen_t dalen
Destination address.
const struct sockaddr * saddr
Length of destination address.
socklen_t salen
Optional Source address.
ssize_t len
Address of data.
Information for sending data.
size_t len
Pointer to data to be transferred.
Push an external endpoint into the provider.
bool listen
The network endpoint from some external source.
LengthFnx * fnx
Function which gets length.
size_t minlen
Minimum data length to get length.
socklen_t lalen
Listen address.
int backlog
Length of listen address.
bool fill
Length of data read.
size_t len
Address of data.
ssize_t len
Buffer to be released.
Initiate SSL/TLS on the stream.
const char * hostname
The context for SSL.
bool client
Hostname to check (can be NULL)
StatusIndication()
The provider sending the status.
Provider * provider
Gives details of error.
int value
Option whose value is to be set.