|
The Assimilation Monitoring Project
|
Class for holding/storing various kinds of NetAddr class network addresses. More...
|
Functions | |
| FSTATIC gboolean | _ipportframe_default_isvalid (const Frame *self, gconstpointer tlvptr,gconstpointer pktend) |
| IpPortFrame class 'isvalid' member function - checks address type and length. More... | |
| FSTATIC void | _ipportframe_setaddr (IpPortFrame *self, guint16 frametype, guint16 port, gconstpointer addr, gsize addrlen) |
| FSTATIC NetAddr * | _ipportframe_getnetaddr (IpPortFrame *self) |
| FSTATIC void | _ipportframe_finalize (AssimObj *obj) |
| Finalize an IpPortFrame. More... | |
| FSTATIC IpPortFrame * | ipportframe_new (guint16 frame_type,gsize framesize) |
| Construct a new IpPortFrame class - allowing for "derived" frame types... More... | |
| WINEXPORT IpPortFrame * | ipportframe_ipv4_new (guint16 frame_type, guint16 port, gconstpointer addr) |
| Construct and initialize an IPv4 IpPortFrame class. More... | |
| WINEXPORT IpPortFrame * | ipportframe_ipv6_new (guint16 frame_type, guint16 port, gconstpointer addr) |
| Construct and initialize an IPv6 IpPortFrame class. More... | |
| WINEXPORT IpPortFrame * | ipportframe_netaddr_new (guint16 frame_type, NetAddr *addr) |
| Construct and initialize an IpPortFrame class from a IP NetAddr class. More... | |
| WINEXPORT Frame * | ipportframe_tlvconstructor (gconstpointer tlvstart, gconstpointer pktend) |
| Given marshalled packet data corresponding to an IpPortFrame (address), return the corresponding Frame class In other words, un-marshall the data... More... | |
| FSTATIC gchar * | _ipportframe_toString (gconstpointer aself) |
| Convert IPaddrPortFrame object into a printable string. More... | |
| typedef struct _IpPortFrame | IpPortFrame |
| This is our IpPortFrame class object - used for holding NetAddr class network addresses with non-zero port numbers It has some different member functions implementations than its base Frame class - mainly for validating packet contents. More... | |
Class for holding/storing various kinds of NetAddr class network addresses.
We're a subclass of Frame class.
| typedef struct _IpPortFrame IpPortFrame |
This is our IpPortFrame class object - used for holding NetAddr class network addresses with non-zero port numbers It has some different member functions implementations than its base Frame class - mainly for validating packet contents.
Definition at line 39 of file ipportframe.h.
| FSTATIC gboolean _ipportframe_default_isvalid | ( | const Frame * | self, |
| gconstpointer | tlvptr, | ||
| gconstpointer | pktend | ||
| ) |
IpPortFrame class 'isvalid' member function - checks address type and length.
It only allows IPv4 and IPv6 address types.
| [in,out] | self | IpPortFrame object ('this') |
| [in] | tlvptr | Pointer to the TLV for this IpPortFrame |
| [in] | pktend | Pointer to one byte past the end of the packet |
Definition at line 75 of file ipportframe.c.
References __FUNCTION__, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, get_generic_tlv_len(), get_generic_tlv_value(), tlv_get_guint16(), TLVIPV4SIZE, and TLVIPV6SIZE.
Referenced by ipportframe_new(), and ipportframe_tlvconstructor().


Finalize an IpPortFrame.
Definition at line 162 of file ipportframe.c.
References CASTTOCLASS, FREE, and UNREF.
Referenced by ipportframe_new().

| FSTATIC NetAddr * _ipportframe_getnetaddr | ( | IpPortFrame * | self | ) |
Definition at line 154 of file ipportframe.c.
Referenced by ipportframe_new().

| FSTATIC void _ipportframe_setaddr | ( | IpPortFrame * | self, |
| guint16 | frametype, | ||
| guint16 | port, | ||
| gconstpointer | addr, | ||
| gsize | addrlen | ||
| ) |
Definition at line 125 of file ipportframe.c.
References _IpPortFrame::_addr, _IpPortFrame::baseclass, FREE, _Frame::length, MALLOC, netaddr_new(), _IpPortFrame::port, _NetAddr::setport, tlv_set_guint16(), and _Frame::value.
Referenced by ipportframe_ipv4_new(), ipportframe_ipv6_new(), and ipportframe_tlvconstructor().


| FSTATIC gchar * _ipportframe_toString | ( | gconstpointer | aself | ) |
Convert IPaddrPortFrame object into a printable string.
Definition at line 305 of file ipportframe.c.
References CASTTOCONSTCLASS.
Referenced by ipportframe_new().

| WINEXPORT IpPortFrame* ipportframe_ipv4_new | ( | guint16 | frame_type, |
| guint16 | port, | ||
| gconstpointer | addr | ||
| ) |
Construct and initialize an IPv4 IpPortFrame class.
| [in] | frame_type | TLV type of the IpPortFrame class (not address type) frame |
| [in] | port | port number |
| [in] | addr | pointer to the (binary) IPv4 address data |
Definition at line 199 of file ipportframe.c.
References _ipportframe_setaddr(), ADDR_FAMILY_IPV4, and ipportframe_new().
Referenced by ipportframe_netaddr_new().


| WINEXPORT IpPortFrame* ipportframe_ipv6_new | ( | guint16 | frame_type, |
| guint16 | port, | ||
| gconstpointer | addr | ||
| ) |
Construct and initialize an IPv6 IpPortFrame class.
| [in] | frame_type | TLV type of the IpPortFrame class (not address type) frame |
| [in] | port | port number |
| [in] | addr | pointer to the (binary) IPv6 address data |
Definition at line 217 of file ipportframe.c.
References _ipportframe_setaddr(), ADDR_FAMILY_IPV6, and ipportframe_new().
Referenced by ipportframe_netaddr_new().


| WINEXPORT IpPortFrame* ipportframe_netaddr_new | ( | guint16 | frame_type, |
| NetAddr * | addr | ||
| ) |
Construct and initialize an IpPortFrame class from a IP NetAddr class.
Definition at line 234 of file ipportframe.c.
References _NetAddr::_addrbody, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, _NetAddr::addrtype, ipportframe_ipv4_new(), ipportframe_ipv6_new(), and _NetAddr::port.
Referenced by cma.AssimCclasses.pyIpPortFrame::__init__(), create_sendexpecthb(), create_setconfig(), and nanoprobe_report_upstream().


| FSTATIC IpPortFrame * ipportframe_new | ( | guint16 | frame_type, |
| gsize | framesize | ||
| ) |
Construct a new IpPortFrame class - allowing for "derived" frame types...
This can be used directly for creating IpPortFrame class frames, or by derived classes.
| [in] | frame_type | TLV type of the IpPortFrame class (not address type) frame |
| [in] | framesize | size of frame structure (or zero for sizeof(IpPortFrame)) |
Definition at line 178 of file ipportframe.c.
References _IpPortFrame::_basefinal, _AssimObj::_finalize, _ipportframe_default_isvalid(), _ipportframe_finalize(), _ipportframe_getnetaddr(), _ipportframe_toString(), _IpPortFrame::baseclass, _Frame::baseclass, frame_new(), _IpPortFrame::getnetaddr, _Frame::isvalid, NEWSUBCLASS, and _AssimObj::toString.
Referenced by ipportframe_ipv4_new(), ipportframe_ipv6_new(), and ipportframe_tlvconstructor().


Given marshalled packet data corresponding to an IpPortFrame (address), return the corresponding Frame class In other words, un-marshall the data...
Note that this always returns an IpPortFrame class (a subclass of Frame class)
| [in] | tlvstart | pointer to start of where to find our TLV |
| [in] | pktend | pointer to the first invalid address past tlvstart |
Definition at line 259 of file ipportframe.c.
References _ipportframe_default_isvalid(), _ipportframe_setaddr(), ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, _IpPortFrame::baseclass, get_generic_tlv_len(), get_generic_tlv_type(), get_generic_tlv_value(), ipportframe_new(), _Frame::length, tlv_get_guint16(), TLVIPV4SIZE, TLVIPV6SIZE, TLVOVERHEAD, and UNREF2.
