|
The Assimilation Monitoring Project
|
This is our basic NetAddr object. More...
|
Data Structures | |
| struct | _NetAddr |
| The NetAddr class class represents a general network address - whether IP, MAC, or any other type of address. More... | |
Macros | |
| #define | CHAR_BIT 8 |
Functions | |
| FSTATIC gchar * | _netaddr_toString_ipv6_ipv4 (const NetAddr *self, gboolean ipv4format) |
| Convert this IPv6-encapsulated IPv4 NetAddr to a string. More... | |
| FSTATIC gchar * | _netaddr_toString (gconstpointer baseobj) |
| Convert this IPv6-encapsulated IPv4 NetAddr to an IPv4 representation Convert this NetAddr to a string. More... | |
| FSTATIC gchar * | _netaddr_canonStr (const NetAddr *) |
| FSTATIC NetAddr * | _netaddr_toIPv6 (const NetAddr *self) |
| Convert this IPv6-encapsulated IPv4 NetAddr to an IPv4 representation. More... | |
| FSTATIC gchar * | _netaddr_toStringflex (const NetAddr *self, gboolean canon_format) |
| Convert this NetAddr to a string. More... | |
| FSTATIC gboolean | _netaddr_equal (const NetAddr *self, const NetAddr *other) |
| Return TRUE if these two addresses are "equal" (equivalent) More... | |
| FSTATIC guint | _netaddr_hash (const NetAddr *self) |
| NetAddr hash function which worries about denial of service via hash collisions. More... | |
| WINEXPORT gboolean | netaddr_g_hash_equal (gconstpointer lhs, gconstpointer rhs) |
| g_hash_table equal comparator for a NetAddr More... | |
| WINEXPORT guint | netaddr_g_hash_hash (gconstpointer addrptr) |
| g_hash_table hash function for a NetAddr More... | |
| FSTATIC void | _netaddr_finalize (AssimObj *base) |
| Finalize (free) this object. More... | |
| FSTATIC guint16 | _netaddr_port (const NetAddr *self) |
| Return the port of this NetAddr. More... | |
| FSTATIC void | _netaddr_setport (NetAddr *self, guint16 port) |
| Set the port of this NetAddr. More... | |
| FSTATIC guint16 | _netaddr_addrtype (const NetAddr *self) |
| Return the address type of this NetAddr. More... | |
| FSTATIC gboolean | _netaddr_ismcast (const NetAddr *self) |
| Return TRUE if this is a multicast address. More... | |
| FSTATIC gboolean | _netaddr_islocal (const NetAddr *self) |
| Return TRUE if this is a multicast address. More... | |
| NetAddr * | netaddr_new (gsize objsize, guint16 port, guint16 addrtype, gconstpointer addrbody, guint16 addrlen) |
| Generic NetAddr constructor. More... | |
| FSTATIC NetAddr * | _netaddr_string_ipv4_new (const char *addrstr) |
| Convert a string to an IPv4 NetAddr. More... | |
| FSTATIC NetAddr * | _netaddr_string_ipv6_new (const char *addrstr) |
| Convert a string into an IPv6 address - possibly including a port as per RFC 4291. More... | |
| NetAddr * | netaddr_string_new (const char *addrstr) |
| NetAddr * | netaddr_macaddr_new (gconstpointer macbuf, guint16 maclen) |
| Create new NetAddr from a MAC address. More... | |
| NetAddr * | netaddr_mac48_new (gconstpointer macbuf) |
| Create new NetAddr from a MAC48 address. More... | |
| NetAddr * | netaddr_mac64_new (gconstpointer macbuf) |
| Create new NetAddr from a MAC64 address. More... | |
| NetAddr * | netaddr_ipv4_new (gconstpointer ipbuf, guint16 port) |
| Create new NetAddr from a IPv4 address. More... | |
| NetAddr * | netaddr_ipv6_new (gconstpointer ipbuf, guint16 port) |
| Create new NetAddr from a IPv6 address. More... | |
| NetAddr * | netaddr_sockaddr_new (const struct sockaddr_in6 *sa_in6, socklen_t length) |
| Create new NetAddr from a struct sockaddr More... | |
| FSTATIC struct sockaddr_in6 | _netaddr_ipv6sockaddr (const NetAddr *self) |
| FSTATIC struct sockaddr_in | _netaddr_ipv4sockaddr (const NetAddr *self) |
This is our basic NetAddr object.
It represents network addresses of any of a wide variety of well-known well-known types. It is a class from which we might eventually make subclasses, and is managed by our C-Class Management system.
| #define CHAR_BIT 8 |
Definition at line 309 of file netaddr.c.
Referenced by _netaddr_hash().
Return the address type of this NetAddr.
Definition at line 423 of file netaddr.c.
Referenced by netaddr_new().

Definition at line 110 of file netaddr.c.
References _netaddr_toStringflex().
Referenced by netaddr_new().


Return TRUE if these two addresses are "equal" (equivalent)
Definition at line 228 of file netaddr.c.
References __FUNCTION__, _NetAddr::_addrbody, _NetAddr::_addrlen, _NetAddr::_addrport, _NetAddr::_addrtype, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, CONST_IPV6_IPV4SPACE, and DEBUGMSG5.
Referenced by netaddr_new().

Finalize (free) this object.
Definition at line 393 of file netaddr.c.
References CASTTOCLASS, FREE, and FREECLASSOBJ.
Referenced by netaddr_new().

NetAddr hash function which worries about denial of service via hash collisions.
Note that this function will produce results unique to this process instance. This is to avoid denial of service through has hash collisions
Definition at line 315 of file netaddr.c.
References __FUNCTION__, _NetAddr::_addrbody, _NetAddr::_addrlen, _NetAddr::_addrport, _NetAddr::_addrtype, _netaddr_toIPv6(), ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, CHAR_BIT, CONST_IPV6_LOOPBACK, DEBUGMSG5, netaddr_ipv6_new(), and UNREF.
Referenced by netaddr_new().


Definition at line 977 of file netaddr.c.
References ADDR_FAMILY_IPV4.
Referenced by netaddr_new().

Definition at line 930 of file netaddr.c.
References __FUNCTION__, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, and DEBUGMSG3.
Referenced by netaddr_new().

Return TRUE if this is a multicast address.
Definition at line 447 of file netaddr.c.
References ADDR_FAMILY_IPV4, and ADDR_FAMILY_IPV6.
Referenced by netaddr_new().

Return TRUE if this is a multicast address.
Definition at line 430 of file netaddr.c.
References ADDR_FAMILY_IPV4.
Referenced by netaddr_new().

Return the port of this NetAddr.
Definition at line 407 of file netaddr.c.
Referenced by netaddr_new().

Set the port of this NetAddr.
Definition at line 415 of file netaddr.c.
Referenced by netaddr_new().

Convert a string to an IPv4 NetAddr.
Definition at line 522 of file netaddr.c.
References DIMOF, and netaddr_ipv4_new().
Referenced by netaddr_string_new().


Convert a string into an IPv6 address - possibly including a port as per RFC 4291.
Format is either abcd:efab:cdab:cdef:abcd:efab:cdab:cdef with :: standing in for missing zeroes - or [abcd:efab:cdab:cdef:abcd:efab:cdab:cdef]:port-in-decimal - as per standard convention and the RFC.
Definition at line 638 of file netaddr.c.
References __FUNCTION__, _NetAddr::baseclass, CONST_IPV6_IPV4SPACE, DEBUGMSG5, DIMOF, DUMP5, and netaddr_ipv6_new().
Referenced by netaddr_string_new().


Convert this IPv6-encapsulated IPv4 NetAddr to an IPv4 representation.
Definition at line 117 of file netaddr.c.
References ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, CONST_IPV6_IPV4SPACE, and netaddr_ipv6_new().
Referenced by _netaddr_hash(), and netaddr_new().


| FSTATIC gchar * _netaddr_toString | ( | gconstpointer | baseobj | ) |
Convert this IPv6-encapsulated IPv4 NetAddr to an IPv4 representation Convert this NetAddr to a string.
Definition at line 103 of file netaddr.c.
References _netaddr_toStringflex(), and CASTTOCONSTCLASS.
Referenced by netaddr_new().


Convert this IPv6-encapsulated IPv4 NetAddr to a string.
Definition at line 71 of file netaddr.c.
Referenced by _netaddr_toStringflex().

Convert this NetAddr to a string.
Definition at line 148 of file netaddr.c.
References _netaddr_toString_ipv6_ipv4(), ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, and cma.tests.cma_test::byte1.
Referenced by _netaddr_canonStr(), and _netaddr_toString().


| WINEXPORT gboolean netaddr_g_hash_equal | ( | gconstpointer | lhs, |
| gconstpointer | rhs | ||
| ) |
g_hash_table equal comparator for a NetAddr
Definition at line 376 of file netaddr.c.
References CASTTOCONSTCLASS, and _NetAddr::equal.
Referenced by main(), and netio_new().

| WINEXPORT guint netaddr_g_hash_hash | ( | gconstpointer | addrptr | ) |
g_hash_table hash function for a NetAddr
Definition at line 385 of file netaddr.c.
References CASTTOCONSTCLASS.
Referenced by main(), and netio_new().

| NetAddr* netaddr_ipv4_new | ( | gconstpointer | ipbuf, |
| guint16 | port | ||
| ) |
Create new NetAddr from a IPv4 address.
| [in] | ipbuf | Pointer to 4-byte IPv4 address |
| [in] | port | Port (or zero for non-port-specific IP address) |
Definition at line 889 of file netaddr.c.
References ADDR_FAMILY_IPV4, and netaddr_new().
Referenced by cma.AssimCclasses.pyNetAddr::__init__(), _netaddr_string_ipv4_new(), main(), and cma.AssimCclasses.pyNetIO::recvframesets().


| NetAddr* netaddr_ipv6_new | ( | gconstpointer | ipbuf, |
| guint16 | port | ||
| ) |
Create new NetAddr from a IPv6 address.
| [in] | ipbuf | Pointer to 16-byte IPv6 address |
| [in] | port | Port (or zero for non-port-specific IP address) |
Definition at line 897 of file netaddr.c.
References ADDR_FAMILY_IPV6, and netaddr_new().
Referenced by cma.AssimCclasses.pyNetAddr::__init__(), _netaddr_hash(), _netaddr_string_ipv6_new(), _netaddr_toIPv6(), and main().


| NetAddr* netaddr_mac48_new | ( | gconstpointer | macbuf | ) |
Create new NetAddr from a MAC48 address.
| [in] | macbuf | Pointer to physical (MAC) address |
Definition at line 875 of file netaddr.c.
References netaddr_macaddr_new().
Referenced by cma.AssimCclasses.pyNetAddr::__init__(), and cma.AssimCclasses.SwitchDiscovery::decode_discovery().


| NetAddr* netaddr_mac64_new | ( | gconstpointer | macbuf | ) |
Create new NetAddr from a MAC64 address.
| [in] | macbuf | Pointer to physical (MAC) address |
Definition at line 882 of file netaddr.c.
References netaddr_macaddr_new().
Referenced by cma.AssimCclasses.pyNetAddr::__init__(), and cma.AssimCclasses.SwitchDiscovery::decode_discovery().


| NetAddr* netaddr_macaddr_new | ( | gconstpointer | macbuf, |
| guint16 | maclen | ||
| ) |
Create new NetAddr from a MAC address.
| [in] | macbuf | Pointer to physical (MAC) address |
| [in] | maclen | length of 'macbuf' |
Definition at line 865 of file netaddr.c.
References ADDR_FAMILY_802, and netaddr_new().
Referenced by netaddr_mac48_new(), and netaddr_mac64_new().


| NetAddr* netaddr_new | ( | gsize | objsize, |
| guint16 | port, | ||
| guint16 | addrtype, | ||
| gconstpointer | addrbody, | ||
| guint16 | addrlen | ||
| ) |
Generic NetAddr constructor.
| [in] | objsize | Size of object to construct |
| [in] | port | Port (if applicable) |
| [in] | addrtype | IETF/IANA address type |
| [in] | addrbody | Pointer to address body |
| [in] | addrlen | Length of address |
Definition at line 474 of file netaddr.c.
References _NetAddr::_addrport, _AssimObj::_finalize, _netaddr_addrtype(), _netaddr_canonStr(), _netaddr_equal(), _netaddr_finalize(), _netaddr_hash(), _netaddr_ipv4sockaddr(), _netaddr_ipv6sockaddr(), _netaddr_islocal(), _netaddr_ismcast(), _netaddr_port(), _netaddr_setport(), _netaddr_toIPv6(), _netaddr_toString(), assimobj_new(), BINDDEBUG, CASTTOCLASS, proj_class_register_subclassed(), and _AssimObj::toString.
Referenced by _addrframe_setaddr(), _ipportframe_setaddr(), netaddr_ipv4_new(), netaddr_ipv6_new(), netaddr_macaddr_new(), and netaddr_sockaddr_new().


| NetAddr* netaddr_sockaddr_new | ( | const struct sockaddr_in6 * | sa_in6, |
| socklen_t | length | ||
| ) |
Create new NetAddr from a struct sockaddr
| [in] | sa_in6 | struct sockaddr to construct address from |
| [in] | length | number of bytes in 'sa' |
Definition at line 908 of file netaddr.c.
References ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, and netaddr_new().
Referenced by _netio_boundaddr(), and _netio_recvframesets().


| NetAddr* netaddr_string_new | ( | const char * | addrstr | ) |
Definition at line 848 of file netaddr.c.
References _netaddr_string_ipv4_new(), and _netaddr_string_ipv6_new().
Referenced by cma.AssimCclasses.pyNetAddr::__init__(), _configcontext_JSON_parse_value(), main(), nanoobey_setconfig(), and test_childprocess_modenv().

