The Assimilation Project  based on Assimilation version 0.5.1441048221
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
netaddr.h File Reference

Defines interfaces for the NetAddr (network address) object. More...

#include <projectcommon.h>
#include <assimobj.h>
#include <netinet/in.h>
Include dependency graph for netaddr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _NetAddr
 The NetAddr class class represents a general network address - whether IP, MAC, or any other type of address. More...
 

Typedefs

typedef struct _NetAddr NetAddr
 
#define CONST_IPV6_LOOPBACK   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}
 
#define CONST_IPV4_LOOPBACK   {127,0,0,1}
 
#define CONST_IPV6_IPV4SPACE   0,0,0,0,0,0,0,0,0,0,0xff,0xff
 
#define CONST_IPV6_IPV4START   {CONST_IPV6_IPV4SPACE, 0, 0, 0, 0}
 
#define CONST_IPV6_MACSPACE   0xFE, 0x80, 0, 0, 0, 0, 0, 0x02
 
#define CONST_IPV6_MACSTART   {CONST_IPV6_MACSPACE, 0, 0, 0, 0, 0, 0, 0, 0}
 
#define CONST_ASSIM_DEFAULT_V4_MCAST   {224,0,2,5}
 This is our reserved multicast address. More...
 
WINEXPORT NetAddrnetaddr_new (gsize objsize, guint16 port, guint16 addrtype, gconstpointer addrbody, guint16 addrlen)
 Generic NetAddr constructor. More...
 
WINEXPORT NetAddrnetaddr_sockaddr_new (const struct sockaddr_in6 *, socklen_t)
 Create new NetAddr from a struct sockaddr More...
 
WINEXPORT NetAddrnetaddr_macaddr_new (gconstpointer macbuf, guint16 maclen)
 Create new NetAddr from a MAC address. More...
 
WINEXPORT NetAddrnetaddr_mac48_new (gconstpointer macbuf)
 Create new NetAddr from a MAC48 address. More...
 
WINEXPORT NetAddrnetaddr_mac64_new (gconstpointer macbuf)
 Create new NetAddr from a MAC64 address. More...
 
WINEXPORT NetAddrnetaddr_ipv4_new (gconstpointer ipbuf, guint16 port)
 Create new NetAddr from a IPv4 address. More...
 
WINEXPORT NetAddrnetaddr_ipv6_new (gconstpointer ipbuf, guint16 port)
 Create new NetAddr from a IPv6 address. More...
 
WINEXPORT NetAddrnetaddr_string_new (const char *addrstr)
 Create a NetAddr from an ipv4, ipv6 or MAC address string. More...
 
WINEXPORT NetAddrnetaddr_dns_new (const char *addrstr)
 Create a NetAddr from a DNS name or an ipv4 or ipv6 constant string. 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...
 

Detailed Description

Defines interfaces for the NetAddr (network address) object.

These can be various kinds of network addresses - IPV4, IPv6, MAC addresses, etc. as enumerated by IANA, and covered by RFC 3232 and defined in our IETF/IANA Address Family Numbers.

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 netaddr.h.

Macro Definition Documentation

#define CONST_ASSIM_DEFAULT_V4_MCAST   {224,0,2,5}

This is our reserved multicast address.

Definition at line 84 of file netaddr.h.

#define CONST_IPV4_LOOPBACK   {127,0,0,1}

Definition at line 77 of file netaddr.h.

Referenced by address_tests().

#define CONST_IPV6_IPV4SPACE   0,0,0,0,0,0,0,0,0,0,0xff,0xff
#define CONST_IPV6_IPV4START   {CONST_IPV6_IPV4SPACE, 0, 0, 0, 0}

Definition at line 79 of file netaddr.h.

Referenced by _netio_recvapacket().

#define CONST_IPV6_LOOPBACK   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}

Definition at line 76 of file netaddr.h.

Referenced by _netaddr_hash(), address_tests(), and main().

#define CONST_IPV6_MACSPACE   0xFE, 0x80, 0, 0, 0, 0, 0, 0x02

Definition at line 80 of file netaddr.h.

#define CONST_IPV6_MACSTART   {CONST_IPV6_MACSPACE, 0, 0, 0, 0, 0, 0, 0, 0}

Definition at line 81 of file netaddr.h.

Typedef Documentation

typedef struct _NetAddr NetAddr

Definition at line 36 of file netaddr.h.