gnome-net-address

Name

gnome-net-address -- a network address.

Synopsis



enum        GnomeNetAddressType;
struct      GnomeNetAddress;
GnomeNetAddress* gnome_net_address_new      (GnomeNetAddressType type);
GnomeNetAddress* gnome_net_address_dup      (GnomeNetAddress *addr);
void        gnome_net_address_destroy       (GnomeNetAddress *addr);

Description

Details

enum GnomeNetAddressType

typedef enum {
  GNOME_NET_ADDRESS_INVALID = 0, /* e.g. dns lookup failed */
  GNOME_NET_ADDRESS_INET4   = 1, /* IPv4 */
  GNOME_NET_ADDRESS_INET6   = 2  /* IPv6 */
} GnomeNetAddressType;

Represents a network address type. Currently GNOME_NET_ADDRESS_INET6 is not really supported in the the GNOME socket library.


struct GnomeNetAddress

typedef struct {
  GnomeNetAddressType type; 
  gpointer address;
  guint address_size; /* this must be in _host_ byte order */
} GnomeNetAddress;


gnome_net_address_new ()

GnomeNetAddress* gnome_net_address_new      (GnomeNetAddressType type);

Creates a new network address. If you need, you can fill the address octet-by-octet writing it into the address field of the structure.

type :the type of network address.
Returns :a pointer to the new address.


gnome_net_address_dup ()

GnomeNetAddress* gnome_net_address_dup      (GnomeNetAddress *addr);

Duplicates a network address, creating a copy.

addr :the address to duplicate.
Returns :the duplicate of addr.


gnome_net_address_destroy ()

void        gnome_net_address_destroy       (GnomeNetAddress *addr);

Frees the memory allocated for addr.

addr :the address to destroy.