|
The Assimilation Monitoring Project
|
Class for holding/storing various kinds of NetAddr class network addresses. More...
|
Data Structures | |
| struct | _AddrFrame |
| This is our AddrFrame class object - used for holding NetAddr class network addresses. More... | |
Functions | |
| FSTATIC gboolean | _addrframe_default_isvalid (const Frame *self,gconstpointer tlvptr,gconstpointer pktend) |
| AddrFrame class 'isvalid' member function - checks address type and length. More... | |
| FSTATIC void | _addrframe_setaddr (AddrFrame *f,guint16 addrtype,gconstpointer addr,gsize addrlen) |
| Assign an address to this AddrFrame class object. More... | |
| FSTATIC void | _addrframe_setport (AddrFrame *, guint16 port) |
| FSTATIC NetAddr * | _addrframe_getnetaddr (AddrFrame *self) |
| FSTATIC void | _addrframe_setnetaddr (AddrFrame *self,NetAddr *naddr) |
| Assign a NetAddr to this AddrFrame class object. More... | |
| FSTATIC void | _addrframe_finalize (AssimObj *) |
| WINEXPORT AddrFrame * | addrframe_new (guint16 frame_type, gsize framesize) |
| Construct a new AddrFrame class - allowing for "derived" frame types... More... | |
| WINEXPORT AddrFrame * | addrframe_ipv4_new (guint16 frame_type, gconstpointer addr) |
| Construct and initialize an IPv4 AddrFrame class. More... | |
| WINEXPORT AddrFrame * | addrframe_ipv6_new (guint16 frame_type, gconstpointer addr) |
| Construct and initialize an IPv6 AddrFrame class. More... | |
| WINEXPORT AddrFrame * | addrframe_mac48_new (guint16 frame_type, gconstpointer addr) |
| Construct and initialize a 48-bit MAC address AddrFrame class. More... | |
| WINEXPORT AddrFrame * | addrframe_mac64_new (guint16 frame_type, gconstpointer addr) |
| Construct and initialize a 64-bit MAC address AddrFrame class. More... | |
| WINEXPORT Frame * | addrframe_tlvconstructor (gconstpointer tlvstart, gconstpointer pktend) |
| Given marshalled packet data corresponding to an AddrFrame (address), return the corresponding Frame class In other words, un-marshall the data... More... | |
| FSTATIC char * | _addrframe_toString (gconstpointer aself) |
| Convert AddrFrame object into a printable string. More... | |
Class for holding/storing various kinds of NetAddr class network addresses.
We're a subclass of Frame class.
| FSTATIC gboolean _addrframe_default_isvalid | ( | const Frame * | self, |
| gconstpointer | tlvptr, | ||
| gconstpointer | pktend | ||
| ) |
AddrFrame class 'isvalid' member function - checks address type and length.
Note that this checking is more thorough for IPV4, IPV5 and MAC addresses than for any other types. Right now it does allow other address types, but perhaps they should be disallowed? Each of the classes that use this class should make sure that the address held in an AddrFrame class is suitable to the purpose at hand. We need to support MAC addresses, but they can't be used in a context that requires some kind of IP address. So, caveat emptor has to be the rule of the day anyway.
| [in,out] | self | AddrFrame object ('this') |
| [in] | tlvptr | Pointer to the TLV for this AddrFrame |
| [in] | pktend | Pointer to one byte past the end of the packet |
Definition at line 75 of file addrframe.c.
References ADDR_FAMILY_802, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, get_generic_tlv_len(), get_generic_tlv_value(), and tlv_get_guint16().
Referenced by _addrframe_setnetaddr(), addrframe_new(), and addrframe_tlvconstructor().


Definition at line 185 of file addrframe.c.
References CASTTOCLASS, FREE, and UNREF.
Referenced by addrframe_new().

Definition at line 162 of file addrframe.c.
Referenced by addrframe_new().

| FSTATIC void _addrframe_setaddr | ( | AddrFrame * | self, |
| guint16 | frametype, | ||
| gconstpointer | addr, | ||
| gsize | addrlen | ||
| ) |
Assign an address to this AddrFrame class object.
Definition at line 129 of file addrframe.c.
References _AddrFrame::_addr, _AddrFrame::baseclass, FREE, _Frame::length, MALLOC, netaddr_new(), tlv_set_guint16(), and _Frame::value.
Referenced by addrframe_new().


Assign a NetAddr to this AddrFrame class object.
| [in,out] | self | AddrFrame whose address we're setting... |
| [in] | naddr | NetAddr value to set it to. We hold a reference to it. |
Definition at line 169 of file addrframe.c.
References _NetAddr::_addrbody, _addrframe_default_isvalid(), _NetAddr::_addrlen, _NetAddr::addrtype, and UNREF.
Referenced by addrframe_new().


Definition at line 152 of file addrframe.c.
Referenced by addrframe_new().

| FSTATIC gchar * _addrframe_toString | ( | gconstpointer | aself | ) |
Convert AddrFrame object into a printable string.
Definition at line 303 of file addrframe.c.
References CASTTOCONSTCLASS.
Referenced by addrframe_new().

Construct and initialize an IPv4 AddrFrame class.
| [in] | frame_type | TLV type of the AddrFrame class (not address type) frame |
| [in] | addr | pointer to the (binary) IPv4 address data |
Definition at line 229 of file addrframe.c.
References ADDR_FAMILY_IPV4, addrframe_new(), and _AddrFrame::setaddr.
Referenced by address_tests().


Construct and initialize an IPv6 AddrFrame class.
| [in] | frame_type | TLV type of the AddrFrame class (not address type) frame |
| [in] | addr | pointer to the (binary) IPv6 address data |
Definition at line 241 of file addrframe.c.
References ADDR_FAMILY_IPV6, addrframe_new(), and _AddrFrame::setaddr.
Referenced by address_tests().


Construct and initialize a 48-bit MAC address AddrFrame class.
| [in] | frame_type | TLV type of the AddrFrame class (not address type) frame |
| [in] | addr | pointer to the (binary) MAC address data |
Definition at line 253 of file addrframe.c.
References ADDR_FAMILY_802, addrframe_new(), and _AddrFrame::setaddr.
Referenced by address_tests().


Construct and initialize a 64-bit MAC address AddrFrame class.
| [in] | frame_type | TLV type of the AddrFrame class (not address type) frame |
| [in] | addr | pointer to the (binary) MAC address data |
Definition at line 264 of file addrframe.c.
References ADDR_FAMILY_802, addrframe_new(), and _AddrFrame::setaddr.
Referenced by address_tests().


Construct a new AddrFrame class - allowing for "derived" frame types...
This can be used directly for creating AddrFrame class frames, or by derived classes.
| [in] | frame_type | TLV type of the AddrFrame class (not address type) frame |
| [in] | framesize | size of frame structure (or zero for sizeof(AddrFrame)) |
Definition at line 201 of file addrframe.c.
References _AddrFrame::_addr, _addrframe_default_isvalid(), _addrframe_finalize(), _addrframe_getnetaddr(), _addrframe_setaddr(), _addrframe_setnetaddr(), _addrframe_setport(), _addrframe_toString(), _AddrFrame::_basefinal, _AssimObj::_finalize, _Frame::baseclass, CASTTOCLASS, frame_new(), _AddrFrame::getnetaddr, _Frame::isvalid, proj_class_register_subclassed(), _AddrFrame::setaddr, _AddrFrame::setnetaddr, _AddrFrame::setport, and _AssimObj::toString.
Referenced by cma.AssimCclasses.pyAddrFrame::__init__(), address_tests(), addrframe_ipv4_new(), addrframe_ipv6_new(), addrframe_mac48_new(), addrframe_mac64_new(), addrframe_tlvconstructor(), and cast_frameset_tests().


Given marshalled packet data corresponding to an AddrFrame (address), return the corresponding Frame class In other words, un-marshall the data...
Note that this always returns an AddrFrame 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 278 of file addrframe.c.
References _addrframe_default_isvalid(), addrframe_new(), _AddrFrame::baseclass, get_generic_tlv_len(), get_generic_tlv_type(), get_generic_tlv_value(), _Frame::length, _AddrFrame::setaddr, tlv_get_guint16(), and UNREF2.
