The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
_NetIO Struct Reference

This is a basic NetIO class abstract class for doing network I/O. More...

#include <netio.h>

Collaboration diagram for _NetIO:

Public Member Functions

gboolean input_queued (const NetIO *self)
 <[in] TRUE if input is queued ready to be read More...
 
gboolean bindaddr (NetIO *self, const NetAddr *, gboolean silent)
 <[in] Bind this NetIO to the given address More...
 
gboolean mcastjoin (NetIO *self, const NetAddr *, const NetAddr *)
 <Join multicast group More...
 
gboolean setmcast_ttl (NetIO *self, guint8 ttl)
 < Set ipv4 multicast TTL More...
 
gint getfd (const NetIO *self)
 <[in] Return file/socket descriptor More...
 
void setblockio (const NetIO *self, gboolean blocking)
 <[in] Set blocking/non-blocking mode More...
 
gsize getmaxpktsize (const NetIO *self)
 < Return maximum packet size for this NetIO More...
 
gsize setmaxpktsize (NetIO *, gsize)
 < Set maximum packet size More...
 
void sendaframeset (NetIO *self, const NetAddr *dest, FrameSet *frameset)
 < Send a FrameSet list to a NetIO class More...
 
void sendframesets (NetIO *self, const NetAddr *dest, GSList *framesets)
 < Send a FrameSet list to a NetIO class More...
 
GSList * recvframesets (NetIO *, NetAddr **src)
 < Receive a single datagram's framesets More...
 
gboolean sendareliablefs (NetIO *self, NetAddr *dest, guint16 queueid, FrameSet *frameset)
 [out] source address of return result More...
 
gboolean sendreliablefs (NetIO *self, NetAddr *dest, guint16 queueid, GSList *fslist)
 < Reliably send multiple FrameSets (if possible) More...
 
gboolean ackmessage (NetIO *self, NetAddr *dest, FrameSet *frameset)
 < User-level ACK of a message sent reliably More...
 
gboolean supportsreliable (NetIO *self)
 < return TRUE if this object supports reliable transport More...
 
gboolean outputpending (NetIO *self)
 < return TRUE if this object has output pending More...
 
void closeconn (NetIO *self, guint16 qid, const NetAddr *destaddr)
 < Flush packets in queues to this address More...
 
SignFramesignframe (NetIO *self)
 < return a copied SignFrame for use in sending More...
 
Framecryptframe (NetIO *self)
 < return a copied encryption frame for sending More...
 
Framecompressframe (NetIO *self)
 < return a copied compression frame for sending More...
 
void setpktloss (NetIO *self, double rcv, double xmit)
 < Set desired fraction of packet loss - TESTING ONLY! More...
 
void enablepktloss (NetIO *self, gboolean enable)
 < enable packet loss (as set above) More...
 

Data Fields

AssimObj baseclass
 
NetIOstats stats
 Net I/O stats. More...
 
GIOChannel * giosock
 Glib GIOChannel for this socket. More...
 
gint _maxpktsize
 Maximum packet size for this transport. More...
 
ConfigContext_configinfo
 I/O and other configuration information. More...
 
PacketDecoder_decoder
 Decodes packets into FrameSets. More...
 
SignFrame_signframe
 Signature frame to use in signing FrameSets. More...
 
Frame_cryptframe
 Encryption frame to use in encrypting FrameSets. More...
 
Frame_compressframe
 Compression frame to use in compressing FrameSets. More...
 
GHashTable * aliases
 IP address aliases for received packets. More...
 
double _rcvloss
 private: Receive loss fraction More...
 
double _xmitloss
 private: Transmit loss fraction More...
 
gboolean _shouldlosepkts
 private: TRUE to enable packet loss... More...
 
NetAddr *(* boundaddr )(const NetIO *self)
 [in] Object to return bound address/port of More...
 
void(* addalias )(NetIO *, NetAddr *, NetAddr *)
 Add an alias to our received address alias table. More...
 

Detailed Description

This is a basic NetIO class abstract class for doing network I/O.

It is an abstract class from which you must make subclasses, and is managed by our C-Class Management system.

Definition at line 57 of file netio.h.

Member Function Documentation

gboolean _NetIO::ackmessage ( NetIO self,
NetAddr dest,
FrameSet frameset 
)

< User-level ACK of a message sent reliably

Parameters
[in,out]self'this' object pointer
[in]destdestination address
[in]framesetThe FrameSet to ACK - note that it must have a sequence number. Good thing to remember that the client (that is you has to ACK packets or they won't get ACKed - which will totally ball things up...

Referenced by netio_new(), and obey_pingpong().

Here is the caller graph for this function:

gboolean _NetIO::bindaddr ( NetIO self,
const NetAddr ,
gboolean  silent 
)

<[in] Bind this NetIO to the given address

Parameters
[in,out]selfObject to bind
[in]silentTRUE if no message on failure

Referenced by main(), and netio_new().

Here is the caller graph for this function:

void _NetIO::closeconn ( NetIO self,
guint16  qid,
const NetAddr destaddr 
)

< Flush packets in queues to this address

Parameters
self'this' object pointer
qidQueue id for this connection
destaddrAddress we're flushing for

Referenced by nanoobey_stopexpecthb(), and netio_new().

Here is the caller graph for this function:

Frame* _NetIO::compressframe ( NetIO self)

< return a copied compression frame for sending

Parameters
[in]self'this' object

Referenced by netio_new().

Here is the caller graph for this function:

Frame* _NetIO::cryptframe ( NetIO self)

< return a copied encryption frame for sending

[in] 'this' object

Referenced by netio_new().

Here is the caller graph for this function:

void _NetIO::enablepktloss ( NetIO self,
gboolean  enable 
)

< enable packet loss (as set above)

Parameters
[in,out]self'this' object
enableTRUE == enable, FALSE == disable

Referenced by main(), and netio_new().

Here is the caller graph for this function:

gint _NetIO::getfd ( const NetIO self)

<[in] Return file/socket descriptor

[in] 'this' Object

Referenced by netgsource_new(), and netio_new().

Here is the caller graph for this function:

gsize _NetIO::getmaxpktsize ( const NetIO self)

< Return maximum packet size for this NetIO

'this' object

Referenced by netio_new().

Here is the caller graph for this function:

gboolean _NetIO::input_queued ( const NetIO self)

<[in] TRUE if input is queued ready to be read

The Object to examine

Referenced by netio_new().

Here is the caller graph for this function:

gboolean _NetIO::mcastjoin ( NetIO self,
const NetAddr ,
const NetAddr  
)

<Join multicast group

[in] local if addr or NULL

Parameters
[in,out]selfObject to bind

Referenced by main(), and netio_new().

Here is the caller graph for this function:

gboolean _NetIO::outputpending ( NetIO self)

< return TRUE if this object has output pending

Parameters
[in,out]self'this' object pointer

Referenced by _nano_final_shutdown(), and netio_new().

Here is the caller graph for this function:

GSList* _NetIO::recvframesets ( NetIO ,
NetAddr **  src 
)

< Receive a single datagram's framesets

<

Returns
GSList of FrameSets from packet

Referenced by netio_new(), and reliableudp_new().

Here is the caller graph for this function:

void _NetIO::sendaframeset ( NetIO self,
const NetAddr dest,
FrameSet frameset 
)

< Send a FrameSet list to a NetIO class

<

Precondition
must have non-NULL _signframe
Parameters
[in,out]self'this' object pointer
[in]destdestination address
[in]framesetFrameSet to send

Referenced by _fsprotocol_xmitifwecan(), _netgsource_sendaframeset(), netio_new(), and reliableudp_new().

Here is the caller graph for this function:

gboolean _NetIO::sendareliablefs ( NetIO self,
NetAddr dest,
guint16  queueid,
FrameSet frameset 
)

[out] source address of return result

< Reliably send a single FrameSet (if possible) <

Precondition
must have non-NULL _signframe
Parameters
[in,out]self'this' object pointer
[in]destdestination address
[in]queueidThe queue id to send it to
[in]framesetThe FrameSet to send

Referenced by _jsondiscovery_send(), _nano_send_rscexitstatus(), _switchdiscovery_dispatch(), fakecma_startup(), main(), nanoprobe_report_upstream(), and netio_new().

Here is the caller graph for this function:

void _NetIO::sendframesets ( NetIO self,
const NetAddr dest,
GSList *  framesets 
)

< Send a FrameSet list to a NetIO class

<

Precondition
must have non-NULL _signframe
Parameters
[in,out]self'this' object pointer
[in]destdestination address
[in]framesetsList of FrameSets to send

Referenced by _netgsource_sendframesets(), netio_new(), and reliableudp_new().

Here is the caller graph for this function:

gboolean _NetIO::sendreliablefs ( NetIO self,
NetAddr dest,
guint16  queueid,
GSList *  fslist 
)

< Reliably send multiple FrameSets (if possible)

<

Precondition
must have non-NULL _signframe
Parameters
[in,out]self'this' object pointer
[in]destdestination address
[in]queueidThe queue id to send it to
[in]fslistThe list of FrameSets to send

Referenced by netio_new(), and obey_pingpong().

Here is the caller graph for this function:

void _NetIO::setblockio ( const NetIO self,
gboolean  blocking 
)

<[in] Set blocking/non-blocking mode

Parameters
[in,out]self'this' Object.
[in]blockingTRUE if you want it to block

Referenced by netgsource_new(), and netio_new().

Here is the caller graph for this function:

gsize _NetIO::setmaxpktsize ( NetIO ,
gsize   
)

< Set maximum packet size

size to set max pkt size to

Referenced by netio_new().

Here is the caller graph for this function:

gboolean _NetIO::setmcast_ttl ( NetIO self,
guint8  ttl 
)

< Set ipv4 multicast TTL

Parameters
[in,out]selfObject to set mcast TTL for
[in]ttlMulticast TTL value

Referenced by main(), and netio_new().

Here is the caller graph for this function:

void _NetIO::setpktloss ( NetIO self,
double  rcv,
double  xmit 
)

< Set desired fraction of packet loss - TESTING ONLY!

Parameters
[in,out]self'this' object
rcvPacket receive loss fraction (0:1]
xmitPacket transmission loss (0:1]

Referenced by main(), and netio_new().

Here is the caller graph for this function:

SignFrame* _NetIO::signframe ( NetIO self)

< return a copied SignFrame for use in sending

[in]

Referenced by netio_new().

Here is the caller graph for this function:

gboolean _NetIO::supportsreliable ( NetIO self)

< return TRUE if this object supports reliable transport

Parameters
[in,out]self'this' object pointer

Referenced by netio_new().

Here is the caller graph for this function:

Field Documentation

Frame* _NetIO::_compressframe

Compression frame to use in compressing FrameSets.

Definition at line 66 of file netio.h.

Referenced by netio_new().

ConfigContext* _NetIO::_configinfo

I/O and other configuration information.

Definition at line 62 of file netio.h.

Referenced by netio_new().

Frame* _NetIO::_cryptframe

Encryption frame to use in encrypting FrameSets.

Definition at line 65 of file netio.h.

Referenced by netio_new().

PacketDecoder* _NetIO::_decoder

Decodes packets into FrameSets.

Definition at line 63 of file netio.h.

Referenced by netio_new().

gint _NetIO::_maxpktsize

Maximum packet size for this transport.

Definition at line 61 of file netio.h.

Referenced by netio_new().

double _NetIO::_rcvloss

private: Receive loss fraction

Definition at line 68 of file netio.h.

gboolean _NetIO::_shouldlosepkts

private: TRUE to enable packet loss...

Definition at line 70 of file netio.h.

SignFrame* _NetIO::_signframe

Signature frame to use in signing FrameSets.

Definition at line 64 of file netio.h.

Referenced by netio_new().

double _NetIO::_xmitloss

private: Transmit loss fraction

Definition at line 69 of file netio.h.

void(* _NetIO::addalias)(NetIO *, NetAddr *, NetAddr *)

Add an alias to our received address alias table.

Definition at line 87 of file netio.h.

Referenced by nanoobey_setconfig(), and netio_new().

GHashTable* _NetIO::aliases

IP address aliases for received packets.

Definition at line 67 of file netio.h.

Referenced by netio_new().

AssimObj _NetIO::baseclass

Definition at line 58 of file netio.h.

Referenced by _nano_final_shutdown(), netio_new(), and reliableudp_new().

NetAddr*(* _NetIO::boundaddr)(const NetIO *self)

[in] Object to return bound address/port of

Definition at line 78 of file netio.h.

Referenced by main(), and netio_new().

GIOChannel* _NetIO::giosock

Glib GIOChannel for this socket.

Definition at line 60 of file netio.h.

Referenced by netioudp_new().

NetIOstats _NetIO::stats

Net I/O stats.

Definition at line 59 of file netio.h.

Referenced by nano_shutdown(), and netio_new().


The documentation for this struct was generated from the following file: