]> git.meshlink.io Git - catta/blob - address.h
initial commit
[catta] / address.h
1 #ifndef fooaddresshfoo
2 #define fooaddresshfoo
3
4 #include <glib.h>
5
6 typedef struct {
7     guint32 address;
8 } flxIPv4Address;
9
10 typedef struct {
11     guint8 address[16];
12 } flxIPv6Address;
13
14 typedef struct {
15     guint family;
16
17     union {
18         flxIPv6Address ipv6;
19         flxIPv4Address ipv4;
20         guint8 data[0];
21     };
22 } flxAddress;
23
24 guint flx_address_get_size(const flxAddress *a);
25 gint flx_address_cmp(const flxAddress *a, const flxAddress *b);
26
27 gchar *flx_address_snprint(char *s, guint length, const flxAddress *a);
28
29 gchar* flx_reverse_lookup_name(const flxAddress *a);
30
31 #endif