|
OSAPI
0.29
Open System API
|
10 #ifndef OSAPI_COMMON_TYPES_IP_H_
11 #define OSAPI_COMMON_TYPES_IP_H_
23 #include "general/general_types.h"
24 #include "general/general_protocol.h"
27 #include "common/types/common_types_if.h"
35 #define osapi_is_ip_valid_selector( s ) ( s==osapi_protocol_ip || s==osapi_protocol_ipv4 || s==osapi_protocol_ipv6 ? true : false )
36 #define osapi_is_ip_valid_family( f ) ( f==osapi_protocol_ipv4 || f==osapi_protocol_ipv6 ? true : false )
37 #define osapi_is_ipv4_selection( s, f ) ( ( s==osapi_protocol_ip || s==osapi_protocol_ipv4 ) && f==osapi_protocol_ipv4 ? true : false )
38 #define osapi_is_ipv6_selection( s, f ) ( ( s==osapi_protocol_ip || s==osapi_protocol_ipv6 ) && f==osapi_protocol_ipv6 ? true : false )
40 #define osapi_is_ipv4_family( f ) ( f==osapi_protocol_ipv4 ? true : false )
41 #define osapi_is_ipv6_family( f ) ( f==osapi_protocol_ipv6 ? true : false )
44 #define osapi_is_ip_address_broadcast( a ) ( (a & IFF_BROADCAST) ? true : false )
45 #define osapi_is_ip_address_loopback ( a ) ( (a & IFF_LOOPBACK) ? true : false )
46 #define osapi_is_ip_address_up( a ) ( (a & IFF_UP) ? true : false )
47 #define osapi_is_ip_address_running( a ) ( (a & IFF_RUNNING) ? true : false )
48 #define osapi_is_ip_address_multicast( a ) ( (a & IFF_MULTICAST) ? true : false )
49 #define osapi_is_ip_address_promisc( a ) ( (a & IFF_PROMISC) ? true : false )
50 #define osapi_is_ip_address_ptp( a ) ( (a & IFF_POINTOPOINT) ? true : false )
52 #define OSAPI_IP_TARGET_NONE 0
53 #define OSAPI_IP_TARGET_BROADCAST 1
54 #define OSAPI_IP_TARGET_POINT2POINT 2
57 #define OSAPI_IPV4_ADDRESS_SIZE 4
58 #define OSAPI_IPV6_ADDRESS_SIZE 16
67 typedef int t_address_type;
int t_protocol
Definition of a protocol type.
Definition: general_types.h:64
uint8_t Byte
Definition of a Byte type.
Definition: general_types.h:58
Byte p2p[OSAPI_IPV4_ADDRESS_SIZE]
Point to Point address type.
Definition: common_types_ip.h:75
t_address_type type_target
BroadCast / PtP target address.
Definition: common_types_ip.h:101
t_protocol protocol
V4/V6 IP protocol.
Definition: common_types_ip.h:99
Structure to support either raw (bunch of bytes) or structured IPv4 addresses.
Definition: common_types_ip.h:79
Union of IPv4/v6 addresses.
Definition: common_types_ip.h:86
char interface_name[OSAPI_INTERFACE_MAX_NAME_SIZE]
Interface name.
Definition: common_types_ip.h:98
Byte raw[OSAPI_IPV6_ADDRESS_SIZE]
Array of the same number of bytes as IPV6 address.
Definition: common_types_ip.h:82
Structure for a structured IPv4 address.
Definition: common_types_ip.h:70
Byte mask[OSAPI_IPV4_ADDRESS_SIZE]
Network mask.
Definition: common_types_ip.h:73
Byte ipv6[OSAPI_IPV6_ADDRESS_SIZE]
An array of bytes to support an IPv6 address.
Definition: common_types_ip.h:89
t_ip_address address
IP address.
Definition: common_types_ip.h:100
Byte broadcast[OSAPI_IPV4_ADDRESS_SIZE]
Broadcast address type or.
Definition: common_types_ip.h:74
union osapi_common_ipv4_address_U ipv4
An union of all possible IPv4 addresses.
Definition: common_types_ip.h:88
Byte host[OSAPI_IPV4_ADDRESS_SIZE]
IP address.
Definition: common_types_ip.h:72
struct osapi_common_ipv4_address_S field
Select individual fields.
Definition: common_types_ip.h:81
Structure to support IP information.
Definition: common_types_ip.h:96