The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
netio.h
Go to the documentation of this file.
1 
26 #ifndef _NETIO_H
27 #define _NETIO_H
28 #include <projectcommon.h>
29 #include <assimobj.h>
30 #include <glib.h>
31 #include <netaddr.h>
32 #include <frame.h>
33 #include <signframe.h>
34 #include <configcontext.h>
35 #include <packetdecoder.h>
36 
39 typedef struct _NetIOstats NetIOstats;
40 struct _NetIOstats {
41  guint64 recvcalls;
42  guint64 pktsread;
43  guint64 fsreads;
44  guint64 sendcalls;
45  guint64 pktswritten;
46  guint64 fswritten;
47  guint64 reliablesends;
48  guint64 reliablereads;
49  guint64 ackssent;
50  guint64 acksrecvd;
51 };
52 typedef struct _NetIO NetIO;
53 
57 struct _NetIO {
60  GIOChannel* giosock;
61  gint _maxpktsize;
67  GHashTable* aliases;
68  double _rcvloss;
69  double _xmitloss;
70  gboolean _shouldlosepkts;
71  gboolean (*input_queued)
72  (const NetIO* self);
73  gboolean (*bindaddr)
74  (NetIO* self,
75  const NetAddr*,
76  gboolean silent)
77  ; // (separate line to work around doxygen bug)
78  NetAddr* (*boundaddr)(const NetIO* self);
79  gboolean (*mcastjoin)
80  (NetIO* self,
81  const NetAddr*,
82  const NetAddr*);
83  gboolean (*setmcast_ttl)
84  (NetIO* self,
85  guint8 ttl)
86  ; // ";" is here to work around a doxygen bug
87  void (*addalias)(NetIO*, NetAddr*, NetAddr*);
88 
89  gint (*getfd)
90  (const NetIO* self);
91  void (*setblockio)
92  (const NetIO* self,
93  gboolean blocking)
94  ; // ";" is here to work around a doxygen bug
95  gsize (*getmaxpktsize)
96  (const NetIO* self);
97  gsize (*setmaxpktsize)
98  (NetIO*,
99  gsize);
100  void (*sendaframeset)
101  (NetIO* self,
103  const NetAddr* dest,
104  FrameSet* frameset)
105  ; // ";" is here to work around a doxygen bug
106  void (*sendframesets)
107  (NetIO* self,
109  const NetAddr* dest,
110  GSList* framesets)
111  ; // ";" is here to work around a doxygen bug
112  GSList* (*recvframesets)
113  (NetIO*,
115  NetAddr** src);
116  gboolean (*sendareliablefs)
117  (NetIO*self,
119  NetAddr* dest,
120  guint16 queueid,
121  FrameSet* frameset)
122  ; // ";" is here to work around a doxygen bug
123  gboolean (*sendreliablefs)
124  (NetIO*self,
126  NetAddr* dest,
127  guint16 queueid,
128  GSList* fslist)
129  ; // ";" is here to work around a doxygen bug
130  gboolean (*ackmessage)
131  (NetIO* self,
132  NetAddr* dest,
133  FrameSet* frameset)
134  ; // ";" is here to work around a doxygen bug
139  gboolean (*supportsreliable)
140  (NetIO* self)
141  ; // ";" is here to work around a doxygen bug
142  gboolean (*outputpending)
143  (NetIO* self)
144  ; // ";" is here to work around a doxygen bug
145  void (*closeconn)
146  (NetIO* self,
147  guint16 qid,
148  const NetAddr* destaddr)
149  ; // ";" is here to work around a doxygen bug
150  SignFrame* (*signframe)
151  (NetIO*self);
152  Frame* (*cryptframe)
153  (NetIO*self);
154  Frame* (*compressframe)
155  (NetIO*self)
156  ; // ";" is here to work around a doxygen bug
157  void (*setpktloss)
158  (NetIO* self,
159  double rcv,
160  double xmit)
161  ; // ";" is here to work around a doxygen bug
162  void (*enablepktloss)
163  (NetIO* self,
164  gboolean enable)
165  ; // ";" is here to work around a doxygen bug
166 };
171 
172 #endif /* _NETIO_H */