File: ipv4.h

package info (click to toggle)
bglibs 2.04%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,468 kB
  • sloc: ansic: 15,821; perl: 674; sh: 63; makefile: 29
file content (31 lines) | stat: -rw-r--r-- 870 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef NET__IPV4__H__
#define NET__IPV4__H__

#include "sysdeps.h"

/** \defgroup ipv4 ipv4: IPv4 Address Handling

@{ */

/** IPv4 address structure. */
typedef struct {
  /** 32-bit IPv4 address, represented as 4 8-bit \c unsigned \c chars. */
  uint8 addr[4];
} ipv4addr;
/** IPv4 port number. */
typedef uint16 ipv4port;

extern const ipv4addr IPV4ADDR_ANY;
extern const ipv4addr IPV4ADDR_BROADCAST;
extern const ipv4addr IPV4ADDR_LOOPBACK;

extern int ipv4_parse(const char* s, ipv4addr* addr, const char** end) __DEPRECATED__;
extern const char* ipv4_scan(const char* s, ipv4addr* addr);
extern const char* ipv4_format(const ipv4addr* addr);
extern const char* ipv4_format_reverse(const ipv4addr* addr);
extern unsigned fmt_ipv4addr(char* buffer, const ipv4addr* addr);
extern unsigned fmt_ipv4addr_reverse(char* buffer, const ipv4addr* addr);

/** @} */

#endif