19#ifndef _DATAGRAMINTERFACE_H_
20#define _DATAGRAMINTERFACE_H_
22#include <isode/ll/internet.h>
23#include <isode/messages/ioevent.h>
43 const struct sockaddr *laddr;
174 this->pduref = src.
pduref;
175 this->info = src.
info;
176 this->provider = src.provider;
177 this->msg.dlen = src.
msg.dlen;
178 if (src.
msg.data == src.
msg.dbuf) {
179 this->msg.data = this->msg.dbuf;
182 this->msg.data = (
unsigned char*)smalloc(src.
msg.dlen);
184 memcpy (this->msg.data, src.
msg.data, src.
msg.dlen);
187 ~StatusIndication () { MSGfree (&
msg); }
191 this->provider = src.provider;
192 this->msg.dlen = src.msg.dlen;
193 if ( src.msg.data == src.msg.dbuf ) {
194 this->msg.data = this->msg.dbuf;
196 this->msg.data = (
unsigned char *)
197 smalloc (src.msg.dlen);
199 memcpy (this->msg.data, src.msg.data, src.msg.dlen);
Provider of a stream interface.
virtual void Deliver(MulticastParams *req)=0
Control multicast sending.
virtual void Deliver(External *ext)=0
Set external.
virtual ~Provider()
Destructor should be virtual.
virtual void Die()=0
Go away.
virtual void Deliver(LengthFnxRequest *req)=0
Set length function.
virtual void Deliver(DataRequest *req)=0
Send data.
virtual void Deliver(MulticastRequest *req)=0
Enable listening for multicast packets.
virtual void Deliver(ReadRequest *req)=0
Pass read buffer.
static EVENTSVC_DLL Provider * ProviderFactory(const char *type, MSGstruct *msp)
Factory method for Stream provider.
User * GetUser()
get the user
Provider()
The user of this provider.
virtual void Deliver(ListenRequest *req)=0
Listen for data on endpoint.
void SetUser(User *u)
set the user
Virtual class defining interface to stream user.
virtual void Deliver(ReleaseBuf *release)=0
Provider finished with write buffer.
virtual ~User()
Destructor should be virtual.
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 datagram service and its provider.
size_t LengthFnx(const char *buf)
Typedef for datagram length function.
ssize_t len
Address of data.
bool arq
Length of source address.
socklen_t salen
Source address.
const struct sockaddr * saddr
Length of data read, -ve means error.
Information for sending data.
void * pduref
Length of destination address.
bool inorder
Use ARQ mode if available.
bool usearq
Reference for this PDU.
enum Datagram::DataRequest::@0 confmode
Deliver PDUs in order.
size_t len
Pointer to data to be transferred.
@ DC_CLIENT_CONF
Force to node.
const struct sockaddr * daddr
Number of bytes to be transferred.
socklen_t dalen
Destination address.
DataRequest()
explicit confirm mode
Push an external endpoint into the provider.
size_t minlen
Minimum data length to get length.
LengthFnx * fnx
Function which gets length.
socklen_t lalen
Listen address.
Set multicast parameters.
int loop
Set the ttl for multicast, 0: no change.
Listen/Stop listening to multicast address.
bool listen
The multicast address.
Request read from provider.
socklen_t salen
Source address buffer.
size_t len
Address of data.
struct sockaddr * saddr
Length of data read.
const char * buf
This provider.
ssize_t len
Buffer to be released.
MSGstruct msg
Reference for the PDU.
void * pduref
This provider.
int info
Gives details of error.
StatusIndication()
For connection events, max pdu size, or error reasons.