The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
addrframe.c File Reference

Implements the AddrFrame class class - A frame for generic network addresses. More...

#include <string.h>
#include <projectcommon.h>
#include <frameset.h>
#include <addrframe.h>
#include <frametypes.h>
#include <generic_tlv_min.h>
#include <tlvhelper.h>
#include <address_family_numbers.h>
Include dependency graph for addrframe.c:

Go to the source code of this file.

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 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_setport (AddrFrame *, guint16 port)
 
FSTATIC void _addrframe_finalize (AssimObj *)
 
FSTATIC char * _addrframe_toString (gconstpointer aself)
 Convert AddrFrame object into a printable string. More...
 
WINEXPORT AddrFrameaddrframe_new (guint16 frame_type, gsize framesize)
 Construct a new AddrFrame class - allowing for "derived" frame types... More...
 
WINEXPORT AddrFrameaddrframe_ipv4_new (guint16 frame_type, gconstpointer addr)
 Construct and initialize an IPv4 AddrFrame class. More...
 
WINEXPORT AddrFrameaddrframe_ipv6_new (guint16 frame_type, gconstpointer addr)
 Construct and initialize an IPv6 AddrFrame class. More...
 
WINEXPORT AddrFrameaddrframe_mac48_new (guint16 frame_type, gconstpointer addr)
 Construct and initialize a 48-bit MAC address AddrFrame class. More...
 
WINEXPORT AddrFrameaddrframe_mac64_new (guint16 frame_type, gconstpointer addr)
 Construct and initialize a 64-bit MAC address AddrFrame class. More...
 
WINEXPORT Frameaddrframe_tlvconstructor (gconstpointer tlvstart, gconstpointer pktend, gpointer *ignorednewpkt, gpointer *ignoredpktend)
 Given marshalled packet data corresponding to an AddrFrame (address), return the corresponding Frame class In other words, un-marshall the data... More...
 

Detailed Description

Implements the AddrFrame class class - A frame for generic network addresses.

AddrFrames consist of a two-byte IANA address family number plus the address. These fields are generally stored in network byte order. We have explicit support for three types, and the rest hopefully can come along for the ride...

See Also
Frame, FrameSet, Generic TLV capabilities
http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml

This file is part of the Assimilation Project.

Author
Copyright © 2011, 2012 - Alan Robertson alanr.nosp@m.@uni.nosp@m.x.sh
The Assimilation software is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

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 addrframe.c.