|
The Assimilation Monitoring Project
|
Implements the IpPortFrame class class - A frame for generic network addresses. More...
#include <string.h>#include <projectcommon.h>#include <frameset.h>#include <ipportframe.h>#include <frametypes.h>#include <generic_tlv_min.h>#include <tlvhelper.h>#include <address_family_numbers.h>
Go to the source code of this file.
Macros | |
| #define | TLVOVERHEAD (sizeof(guint16)+sizeof(guint16)) |
| #define | TLVIPV4SIZE (TLVOVERHEAD+4) |
| IPv4 addresses are 4 bytes. More... | |
| #define | TLVIPV6SIZE (TLVOVERHEAD+16) |
| IPv4 addresses are 16 bytes. 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_setnetaddr (IpPortFrame *self, NetAddr *netaddr) |
| 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... | |
| FSTATIC gchar * | _ipportframe_toString (gconstpointer aself) |
| Convert IPaddrPortFrame object into a printable string. 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... | |
Implements the IpPortFrame class class - A frame for generic network addresses.
IpPortFrames consist of a 2-byte port number followed by a 2-byte IANA address family number plus the address. These fields are stored in network byte order. We only support IPv4 and IPv6 addresses - as the port is mandatory for this object.
This file is part of the Assimilation Project.
The Assimilation software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the Assimilation Project software. If not, see http://www.gnu.org/licenses/
Definition in file ipportframe.c.
| #define TLVIPV4SIZE (TLVOVERHEAD+4) |
IPv4 addresses are 4 bytes.
Definition at line 64 of file ipportframe.c.
Referenced by _ipportframe_default_isvalid(), and ipportframe_tlvconstructor().
| #define TLVIPV6SIZE (TLVOVERHEAD+16) |
IPv4 addresses are 16 bytes.
Definition at line 65 of file ipportframe.c.
Referenced by _ipportframe_default_isvalid(), and ipportframe_tlvconstructor().
| #define TLVOVERHEAD (sizeof(guint16)+sizeof(guint16)) |
Two bytes for port number, and two for the address type
Definition at line 63 of file ipportframe.c.
Referenced by ipportframe_tlvconstructor().
| FSTATIC void _ipportframe_setnetaddr | ( | IpPortFrame * | self, |
| NetAddr * | netaddr | ||
| ) |