|
Hybrid ICN (hICN) plugin
v21.06-rc0-4-g18fa668
|
Go to the documentation of this file.
29 #include <netinet/in.h>
31 #include <hicn/util/ip_address.h>
38 #define TCP_SEQNO_LEN 4
39 #define HICN_V4_PREFIX_LEN IPV4_ADDR_LEN
40 #define HICN_V6_PREFIX_LEN IPV6_ADDR_LEN
41 #define HICN_SEGMENT_LEN TCP_SEQNO_LEN
42 #define HICN_V6_NAME_LEN (HICN_V6_PREFIX_LEN + HICN_SEGMENT_LEN)
43 #define HICN_V4_NAME_LEN (HICN_V4_PREFIX_LEN + HICN_SEGMENT_LEN)
47 typedef u32 hicn_name_suffix_t;
71 hicn_name_suffix_t suffix;
73 u8 buffer[HICN_V4_NAME_LEN];
86 hicn_name_suffix_t suffix;
88 u8 buffer[HICN_V6_NAME_LEN];
91 #ifndef HICN_VPP_PLUGIN
92 #define HICN_NAME_COMPONENT_SIZE 2
96 struct iovec buffers[HICN_NAME_COMPONENT_SIZE];
100 #define HNT_CONTIGUOUS 1 << 1
101 #define HNT_IOV 1 << 2
102 #define HNT_INET 1 << 3
103 #define HNT_INET6 1 << 4
108 HNT_CONTIGUOUS_V4 = HNT_CONTIGUOUS | HNT_INET,
109 HNT_CONTIGUOUS_V6 = HNT_CONTIGUOUS | HNT_INET6,
110 HNT_IOV_V4 = HNT_IOV | HNT_INET,
111 HNT_IOV_V6 = HNT_IOV | HNT_INET6,
117 #ifndef HICN_VPP_PLUGIN
118 hicn_name_type_t type;
126 #ifndef HICN_VPP_PLUGIN
128 u8 buffer[HICN_V6_NAME_LEN];
133 #ifndef HICN_VPP_PLUGIN
134 #define _is_unspec(name) ((name->type & UNSPEC))
135 #define _is_contiguous(name) ((name->type & HNT_CONTIGUOUS) >> 1)
136 #define _is_iov(name) ((name->type & HNT_IOV) >> 2)
137 #define _is_inet4(name) ((name->type & HNT_INET) >> 3)
138 #define _is_inet6(name) ((name->type & HNT_INET6) >> 4)
178 bool consider_segment);
238 struct sockaddr *ip_address);
int hicn_name_to_ip_prefix(const hicn_name_t *name, ip_prefix_t *ip_prefix)
Convert an hICN name to an IP address.
int hicn_name_create(const char *ip_address, u32 id, hicn_name_t *name)
Create an hICN name from IP address in presentation format.
int hicn_name_compare(const hicn_name_t *name_1, const hicn_name_t *name_2, bool consider_segment)
Compare two hICN names.
int hicn_name_create_from_ip_prefix(const ip_prefix_t *prefix, u32 id, hicn_name_t *name)
Create an hICN name from IP address.
int hicn_prefix_create_from_ip_prefix(const ip_prefix_t *ip_prefix, hicn_prefix_t *prefix)
Creates an hICN prefix from an IP address.
int hicn_name_get_family(const hicn_name_t *name, int *family)
Returns the IP address family of an hICN name.
int hicn_name_copy_to_destination(u8 *dst, const hicn_name_t *src, bool copy_suffix)
Copy an hICN name to a buffer.
u8 hicn_name_get_length(const hicn_name_t *name)
Returns the length of an hICN name.
Definition: ip_address.h:103
int hicn_name_to_sockaddr_address(const hicn_name_t *name, struct sockaddr *ip_address)
Convert an hICN name to a socket address.
int hicn_name_copy(hicn_name_t *dst, const hicn_name_t *src)
Copy an hICN name.
int hicn_name_empty(hicn_name_t *name)
Test whether an hICN name is empty.
int hicn_name_ntop(const hicn_name_t *src, char *dst, size_t len)
Convert an hICN name to presentation format.
Definition: windows_utils.h:33
int hicn_name_hash(const hicn_name_t *name, u32 *hash, bool consider_suffix)
Provides a 32-bit hash of an hICN name.
int hicn_name_set_seq_number(hicn_name_t *name, u32 seq_number)
Sets the segment part of an hICN name.
int hicn_name_get_seq_number(const hicn_name_t *name, u32 *seq_number)
Retrieves the segment part of an hICN name.
int hicn_name_pton(const char *src, hicn_name_t *dst)
Convert an hICN name from presentation format.