#include <INET.hh>
|
static bool | is_illegal (uint8_t addr[IP_MAX], uint16_t port) |
|
static int | aton (const char *addr, uint8_t ip[IP_MAX], bool progmem=false) |
|
static int | aton_P (const char *addr, uint8_t ip[IP_MAX]) |
|
static int | nametopath (const char *hostname, char *path, bool progmem=false) |
|
static int | nametopath_P (const char *hostname, char *path) |
|
static void | print_path (IOStream &outs, const char *path) |
|
static void | print_mac (IOStream &outs, const uint8_t mac[MAC_MAX]) |
|
static void | print_addr (IOStream &outs, const uint8_t addr[IP_MAX], uint16_t port=0) |
|
static uint16_t | checksum (const void *buf, size_t count) |
|
Internet message passing support functions.
Definition at line 65 of file INET.hh.
int INET::aton |
( |
const char * |
addr, |
|
|
uint8_t |
ip[IP_MAX], |
|
|
bool |
progmem = false |
|
) |
| |
|
static |
Convert an address string in dot notation to binary form. Returns zero if successful otherwise negative error code.
- Parameters
-
[in] | addr | address string. |
[in,out] | ip | network address. |
[in] | progmem | address string in program memory flag. |
- Returns
- zero if successful otherwise negative error code.
Definition at line 42 of file INET.cpp.
static int INET::aton_P |
( |
const char * |
addr, |
|
|
uint8_t |
ip[IP_MAX] |
|
) |
| |
|
inlinestatic |
Convert an address string in dot notation to binary form. Returns zero if successful otherwise negative error code.
- Parameters
-
[in] | addr | address string in program memory. |
[in,out] | ip | network address. |
- Returns
- zero if successful otherwise negative error code.
Definition at line 110 of file INET.hh.
uint16_t INET::checksum |
( |
const void * |
buf, |
|
|
size_t |
count |
|
) |
| |
|
static |
Calculate Internet Checksum for given buffer with given number of bytes. The buffer should contain data in network order (big-endian). Return check sum.
- Parameters
-
[in] | buf | pointer to buffer. |
[in] | count | number of bytes. |
- Returns
- checksum.
Definition at line 128 of file INET.cpp.
bool INET::is_illegal |
( |
uint8_t |
addr[IP_MAX], |
|
|
uint16_t |
port |
|
) |
| |
|
static |
Check if the given address is illegal (0.0.0.0/255.255.255.255:0).
- Returns
- true if illegal otherwise false.
Definition at line 25 of file INET.cpp.
int INET::nametopath |
( |
const char * |
hostname, |
|
|
char * |
path, |
|
|
bool |
progmem = false |
|
) |
| |
|
static |
Convert an address string in dot notation to a request path. The given path buffer must be able to hold at least PATH_MAX characters. Returns length of path is successful otherwise negative error code.
- Parameters
-
[in] | hostname | address string. |
[in,out] | path | generated path from hostname. |
[in] | progmem | hostname address string in program memory flag. |
- Returns
- length of path if successful otherwise negative error code.
Definition at line 63 of file INET.cpp.
static int INET::nametopath_P |
( |
const char * |
hostname, |
|
|
char * |
path |
|
) |
| |
|
inlinestatic |
Convert an address string in dot notation to a request path. The given path buffer must be able to hold at least PATH_MAX characters. Returns length of path is successful otherwise negative error code.
- Parameters
-
[in] | hostname | address string in program memory. |
[in,out] | path | generated path from hostname. |
- Returns
- length of path if successful otherwise negative error code.
Definition at line 139 of file INET.hh.
void INET::print_addr |
( |
IOStream & |
outs, |
|
|
const uint8_t |
addr[IP_MAX], |
|
|
uint16_t |
port = 0 |
|
) |
| |
|
static |
Print network address and port in extended dot notation to given output stream.
- Parameters
-
[in] | outs | output stream. |
[in] | addr | network address to print. |
[in] | port. | |
Definition at line 119 of file INET.cpp.
void INET::print_mac |
( |
IOStream & |
outs, |
|
|
const uint8_t |
mac[MAC_MAX] |
|
) |
| |
|
static |
Print machine network address hex-colon notation to given output stream.
- Parameters
-
[in] | outs | output stream. |
[in] | mac | machine address to print. |
Definition at line 111 of file INET.cpp.
void INET::print_path |
( |
IOStream & |
outs, |
|
|
const char * |
path |
|
) |
| |
|
static |
Print path in dot notation to given output stream.
- Parameters
-
[in] | outs | output stream. |
[in] | path | to print. |
Definition at line 92 of file INET.cpp.
const uint8_t INET::IP_MAX = 4 |
|
static |
const uint8_t INET::MAC_MAX = 6 |
|
static |
const uint8_t INET::PATH_MAX = 64 |
|
static |
The documentation for this class was generated from the following files: