aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/socket
diff options
context:
space:
mode:
authorLuca Muscariello <muscariello@ieee.org>2022-08-04 16:06:34 +0200
committerLuca Muscariello <muscariello@ieee.org>2022-08-04 16:31:51 +0200
commit6d22a0db96aa7f8e3102ae44d00c09e36a2e9c57 (patch)
tree79546bbf09f6fbf74db7bc89117843f06ce937ea /hicn-light/src/hicn/socket
parent012843b1c0bc0838e69085ed83a79ec8b6f97360 (diff)
feat: Due to the deep modifications related to names and packet format,
this task cover a large part of the codebase and involves several changes: - the library provides a name data structure (hicn_name_t ), which is composed of a name prefix (hicn_name_prefix_t) and a name suffix (hicn_name_suffix_t), and it has been extended to provide all support functions required for name manipulation, including common prefix computation, as required for the Longest Prefix Match (LPM)in the forwarder, in addition to Exact Prefix Match (EPM). - all code has been rewritten to use this data structure instead of having for instance the forwarder define its own name class (used to be Name and NameBitVector) the code has been refactored to minimize name allocations and copies, one remaining aspect is the difference of name storage between PIT and CS entries (respectively in the PIT entry, and in the message buffer), which causes the packet cache index to be updated when a PIT entry is converted into a CS entry. By storing the name in the PIT/CS entry everytime, we might save on this operation). - hicn-light FIB has been rewritten : code has been refactored and should now be shorter and documented; unit tests have been drafted but more would be required to cover all cases and match the algorithms to add/remove nodes, as specified in the doc. all protocol details and hICN header formats are now abstracted by the library for the forwarder (and thus header.h and  protocols/*.h have been removed from public includes, and replaced by packet.h providing protocol agnostic packet level functions, completely replacing the compat.h header that used to provide similar functions. - this works by exposing a opaque buffer to the application (a kind of socket buffer) which is used by the lib to cache the packet format and offsets of the different layers in the buffer and provider efficient operations (the packet format is either defined for packet construction, or guessed at ingress, and this structure is updated accordingly only once). Co-authored-by: Jordan Augé <jordan.auge+fdio@cisco.com> Signed-off-by: Luca Muscariello <muscariello@ieee.org> Change-Id: I31e321897f85f0267fe8ba4720363c180564492f
Diffstat (limited to 'hicn-light/src/hicn/socket')
-rw-r--r--hicn-light/src/hicn/socket/api.c33
-rw-r--r--hicn-light/src/hicn/socket/api.h6
-rw-r--r--hicn-light/src/hicn/socket/ops.h18
-rw-r--r--hicn-light/src/hicn/socket/ops_linux.c100
4 files changed, 84 insertions, 73 deletions
diff --git a/hicn-light/src/hicn/socket/api.c b/hicn-light/src/hicn/socket/api.c
index e39ebf4b5..db377aecd 100644
--- a/hicn-light/src/hicn/socket/api.c
+++ b/hicn-light/src/hicn/socket/api.c
@@ -43,7 +43,7 @@ static hicn_conf_t hicn_default_conf = {
struct ip_rule_state_ {
char tun_name[IF_NAMESIZE];
- ip_prefix_t prefix;
+ hicn_ip_prefix_t prefix;
uint32_t table_id;
uint8_t priority;
uint8_t address_family;
@@ -193,7 +193,7 @@ int hicn_socket_cmp(hicn_socket_t *a, hicn_socket_t *b) {
return b->fd - a->fd;
}
-ip_prefix_t *hicn_socket_get_src_ip(hicn_socket_t *socket) {
+hicn_ip_prefix_t *hicn_socket_get_src_ip(hicn_socket_t *socket) {
if (socket->type != HS_CONNECTION) {
return NULL;
}
@@ -241,7 +241,8 @@ int hicn_set_local_endpoint(hicn_socket_t *socket, const char *local_ip_address,
*/
/* Copy the local IP address inside the connection */
- rc = ip_prefix_pton(local_ip_address, &socket->connection.tun_ip_address);
+ rc =
+ hicn_ip_prefix_pton(local_ip_address, &socket->connection.tun_ip_address);
if (rc < 0) {
rc = HICN_SOCKET_ERROR_SOCKET_LOCAL_REPR;
goto end;
@@ -251,14 +252,14 @@ end:
return rc;
}
-int hicn_get_local_address(const ip_prefix_t *remote_address,
- ip_prefix_t *local_address) {
+int hicn_get_local_address(const hicn_ip_prefix_t *remote_address,
+ hicn_ip_prefix_t *local_address) {
int rc = 0;
uint32_t interface_id;
char remote_address_str[INET_MAX_ADDRSTRLEN + 4];
- rc = ip_prefix_ntop_short(remote_address, remote_address_str,
- sizeof(remote_address_str));
+ rc = hicn_ip_prefix_ntop_short(remote_address, remote_address_str,
+ sizeof(remote_address_str));
if (rc < 0) {
rc = HICN_SOCKET_ERROR_BIND_REMOTE_REPR;
goto ERR;
@@ -289,7 +290,7 @@ ERR:
int hicn_set_remote_endpoint(hicn_socket_t *socket,
const char *remote_ip_address) {
int af, rc = HICN_SOCKET_ERROR_NONE;
- ip_prefix_t addr;
+ hicn_ip_prefix_t addr;
af = get_addr_family(remote_ip_address);
if ((af != AF_INET6) && (af != AF_INET)) {
@@ -297,7 +298,7 @@ int hicn_set_remote_endpoint(hicn_socket_t *socket,
}
/* Bind local endpoint if not done yet */
- if (ip_prefix_empty(&socket->connection.tun_ip_address)) {
+ if (hicn_ip_prefix_empty(&socket->connection.tun_ip_address)) {
char local_ip_address[INET_MAX_ADDRSTRLEN + 4];
/* Local interface id */
@@ -327,8 +328,8 @@ int hicn_set_remote_endpoint(hicn_socket_t *socket,
/////
/* Convert to representation format */
- rc =
- ip_prefix_ntop_short(&addr, local_ip_address, sizeof(local_ip_address));
+ rc = hicn_ip_prefix_ntop_short(&addr, local_ip_address,
+ sizeof(local_ip_address));
if (rc < 0) {
rc = HICN_SOCKET_ERROR_BIND_REMOTE_REPR;
goto ERR;
@@ -445,8 +446,8 @@ int hicn_listen(hicn_socket_helper_t *hicn, int fd, const char *prefix) {
return rc;
}
- ip_prefix_t ip_prefix;
- rc = ip_prefix_pton(prefix, &ip_prefix);
+ hicn_ip_prefix_t hicn_ip_prefix;
+ rc = hicn_ip_prefix_pton(prefix, &hicn_ip_prefix);
if (rc < 0) {
return rc;
}
@@ -457,7 +458,7 @@ int hicn_listen(hicn_socket_helper_t *hicn, int fd, const char *prefix) {
if (punting_table_id == -1) punting_table_id = socket->connection.table_id;
- rc = ops.add_prio_rule(&ip_prefix, ip_prefix.family, 0,
+ rc = ops.add_prio_rule(&hicn_ip_prefix, hicn_ip_prefix.family, 0,
socket->connection.table_id);
if (rc < 0) {
return rc;
@@ -467,8 +468,8 @@ int hicn_listen(hicn_socket_helper_t *hicn, int fd, const char *prefix) {
sizeof(rules_to_remove[rules_counter].tun_name), "NONE");
if (rc != EOK) return -1;
- rules_to_remove[rules_counter].prefix = ip_prefix;
- rules_to_remove[rules_counter].address_family = ip_prefix.family;
+ rules_to_remove[rules_counter].prefix = hicn_ip_prefix;
+ rules_to_remove[rules_counter].address_family = hicn_ip_prefix.family;
rules_to_remove[rules_counter].table_id = socket->connection.table_id;
rules_to_remove[rules_counter].priority = 0;
++rules_counter;
diff --git a/hicn-light/src/hicn/socket/api.h b/hicn-light/src/hicn/socket/api.h
index a0356e035..3caf9ef1e 100644
--- a/hicn-light/src/hicn/socket/api.h
+++ b/hicn-light/src/hicn/socket/api.h
@@ -83,7 +83,7 @@ typedef struct hicn_socket_s {
union {
struct {
- ip_prefix_t tun_ip_address;
+ hicn_ip_prefix_t tun_ip_address;
uint32_t interface_id;
/* ID of the corresponding table : avoid default values of 0, 32766 and
@@ -162,8 +162,8 @@ void hicn_free(hicn_socket_helper_t *hicn);
*
* @return 0 in case of success, -1 otherwise.
*/
-int hicn_get_local_address(const ip_prefix_t *remote_address,
- ip_prefix_t *local_address);
+int hicn_get_local_address(const hicn_ip_prefix_t *remote_address,
+ hicn_ip_prefix_t *local_address);
/* hICN socket */
diff --git a/hicn-light/src/hicn/socket/ops.h b/hicn-light/src/hicn/socket/ops.h
index 1bee7c6f6..854b0c461 100644
--- a/hicn-light/src/hicn/socket/ops.h
+++ b/hicn-light/src/hicn/socket/ops.h
@@ -17,10 +17,10 @@ typedef struct {
int (*get_output_ifid)(const char *ip_address, uint8_t address_family,
uint32_t *interface_id);
int (*get_ip_addr)(uint32_t interface_id, uint8_t address_family,
- ip_prefix_t *ip_address);
- int (*set_ip_addr)(uint32_t interface_id, ip_prefix_t *ip_address);
+ hicn_ip_prefix_t *ip_address);
+ int (*set_ip_addr)(uint32_t interface_id, hicn_ip_prefix_t *ip_address);
int (*up_if)(uint32_t interface_id);
- int (*add_in_route_table)(const ip_prefix_t *prefix,
+ int (*add_in_route_table)(const hicn_ip_prefix_t *prefix,
const uint32_t interface_id,
const uint8_t table_id);
int (*add_in_route_table_s)(const char *prefix, const uint32_t interface_id,
@@ -30,23 +30,23 @@ typedef struct {
const uint8_t table_id, int default_route);
int (*del_out_route)(const char *gateway, const uint8_t address_family,
const uint8_t table_id);
- int (*del_lo_route)(const ip_prefix_t *ip_address);
+ int (*del_lo_route)(const hicn_ip_prefix_t *ip_address);
int (*add_rule)(const char *interface_name, const uint8_t address_family,
const uint8_t table_id);
int (*del_rule)(const char *interface_name, const uint8_t address_family,
const uint8_t table_id);
- int (*add_neigh_proxy)(const ip_prefix_t *ip_address,
+ int (*add_neigh_proxy)(const hicn_ip_prefix_t *ip_address,
const uint32_t interface_id);
- int (*add_prio_rule)(const ip_prefix_t *ip_address,
+ int (*add_prio_rule)(const hicn_ip_prefix_t *ip_address,
const uint8_t address_family, const uint32_t priority,
const uint8_t table_id);
- int (*add_lo_prio_rule)(const ip_prefix_t *ip_address,
+ int (*add_lo_prio_rule)(const hicn_ip_prefix_t *ip_address,
const uint8_t address_family,
const uint32_t priority);
- int (*del_prio_rule)(const ip_prefix_t *ip_address,
+ int (*del_prio_rule)(const hicn_ip_prefix_t *ip_address,
const uint8_t address_family, const uint32_t priority,
const uint8_t table_id);
- int (*del_lo_prio_rule)(const ip_prefix_t *ip_address,
+ int (*del_lo_prio_rule)(const hicn_ip_prefix_t *ip_address,
const uint8_t address_family,
const uint32_t priority);
} hicn_socket_ops_t;
diff --git a/hicn-light/src/hicn/socket/ops_linux.c b/hicn-light/src/hicn/socket/ops_linux.c
index d741fd2e6..a3675e929 100644
--- a/hicn-light/src/hicn/socket/ops_linux.c
+++ b/hicn-light/src/hicn/socket/ops_linux.c
@@ -62,13 +62,13 @@ int _nl_get_output_ifid(const char *ip_address, uint8_t address_family,
* @see getifaddrs
*/
int _nl_get_ip_addr(uint32_t interface_id, uint8_t address_family,
- ip_prefix_t *ip_address);
+ hicn_ip_prefix_t *ip_address);
-int _nl_set_ip_addr(uint32_t interface_id, ip_prefix_t *ip_address);
+int _nl_set_ip_addr(uint32_t interface_id, hicn_ip_prefix_t *ip_address);
int _nl_up_if(uint32_t interface_id);
-int _nl_add_in_route_table(const ip_prefix_t *prefix,
+int _nl_add_in_route_table(const hicn_ip_prefix_t *prefix,
const uint32_t interface_id, const uint8_t table_id);
int _nl_add_in_route_table_s(const char *prefix, const uint32_t interface_id,
const uint8_t table_id);
@@ -79,25 +79,25 @@ int _nl_add_out_route(const char *gateway, const uint8_t address_family,
int _nl_del_out_route(const char *gateway, const uint8_t address_family,
const uint8_t table_id);
-int _nl_del_lo_route(const ip_prefix_t *ip_address);
+int _nl_del_lo_route(const hicn_ip_prefix_t *ip_address);
int _nl_add_rule(const char *interface_name, const uint8_t address_family,
const uint8_t table_id);
int _nl_del_rule(const char *interface_name, const uint8_t address_family,
const uint8_t table_id);
-int _nl_add_neigh_proxy(const ip_prefix_t *ip_address,
+int _nl_add_neigh_proxy(const hicn_ip_prefix_t *ip_address,
const uint32_t interface_id);
-int _nl_add_prio_rule(const ip_prefix_t *ip_address,
+int _nl_add_prio_rule(const hicn_ip_prefix_t *ip_address,
const uint8_t address_family, const uint32_t priority,
const uint8_t table_id);
-int _nl_add_lo_prio_rule(const ip_prefix_t *ip_address,
+int _nl_add_lo_prio_rule(const hicn_ip_prefix_t *ip_address,
const uint8_t address_family, const uint32_t priority);
-int _nl_del_prio_rule(const ip_prefix_t *ip_address,
+int _nl_del_prio_rule(const hicn_ip_prefix_t *ip_address,
const uint8_t address_family, const uint32_t priority,
const uint8_t table_id);
-int _nl_del_lo_prio_rule(const ip_prefix_t *ip_address,
+int _nl_del_lo_prio_rule(const hicn_ip_prefix_t *ip_address,
const uint8_t address_family, const uint32_t priority);
#endif /* HICN_NETLINK_H */
@@ -533,7 +533,7 @@ ERR:
}
int _nl_get_ip_addr(uint32_t interface_id, uint8_t address_family,
- ip_prefix_t *prefix) {
+ hicn_ip_prefix_t *prefix) {
char buffer[BUFSIZE];
struct nlmsghdr *hdr = (struct nlmsghdr *)buffer;
size_t n;
@@ -602,7 +602,7 @@ ERR_SOCKET:
return HICN_SOCKET_ERROR_UNSPEC;
}
-int _nl_set_ip_addr(uint32_t interface_id, ip_prefix_t *prefix) {
+int _nl_set_ip_addr(uint32_t interface_id, hicn_ip_prefix_t *prefix) {
char buffer[BUFSIZE];
struct nlmsghdr *hdr = (struct nlmsghdr *)buffer;
size_t n;
@@ -622,14 +622,15 @@ int _nl_set_ip_addr(uint32_t interface_id, ip_prefix_t *prefix) {
.payload.ifa_index = interface_id};
/* Set attributes = length/type/value */
- struct rtattr ifa_address = {RTA_LENGTH(ip_address_len(prefix->family)),
+ struct rtattr ifa_address = {RTA_LENGTH(hicn_ip_address_len(prefix->family)),
IFA_ADDRESS};
- const void *address = ip_address_get_buffer(&prefix->address, prefix->family);
+ const void *address =
+ hicn_ip_address_get_buffer(&prefix->address, prefix->family);
if (!address) goto ERR_ADDRESS;
const struct iovec iov[] = {
{&msg, sizeof(msg)},
{&ifa_address, sizeof(ifa_address)},
- {(void *)address, ip_address_len(prefix->family)},
+ {(void *)address, hicn_ip_address_len(prefix->family)},
};
msg.hdr.nlmsg_len = iov_length(iov, ARRAY_SIZE(iov));
@@ -967,7 +968,7 @@ ERR_SOCKET:
* ip route del 1:2::2 dev lo table local
*
*/
-int _nl_del_lo_route(const ip_prefix_t *prefix) {
+int _nl_del_lo_route(const hicn_ip_prefix_t *prefix) {
char buffer[BUFSIZE];
struct nlmsghdr *hdr = (struct nlmsghdr *)buffer;
size_t n;
@@ -993,17 +994,20 @@ int _nl_del_lo_route(const ip_prefix_t *prefix) {
/* Set attribute = length/type/value */
uint32_t one = 1;
- struct rtattr a_dst = {RTA_LENGTH(ip_address_len(prefix->family)), RTA_DST};
+ struct rtattr a_dst = {RTA_LENGTH(hicn_ip_address_len(prefix->family)),
+ RTA_DST};
struct rtattr a_ifid_lo = {RTA_LENGTH(sizeof(uint32_t)), RTA_OIF};
- const void *address = ip_address_get_buffer(&prefix->address, prefix->family);
+ const void *address =
+ hicn_ip_address_get_buffer(&prefix->address, prefix->family);
if (!address) goto ERR;
- const struct iovec iov[] = {{&msg, sizeof(msg)},
- /* Ip address */
- {&a_dst, sizeof(a_dst)},
- {(void *)address, ip_address_len(prefix->family)},
- /* Interface id */
- {&a_ifid_lo, sizeof(a_ifid_lo)},
- {&one, sizeof(one)}};
+ const struct iovec iov[] = {
+ {&msg, sizeof(msg)},
+ /* Ip address */
+ {&a_dst, sizeof(a_dst)},
+ {(void *)address, hicn_ip_address_len(prefix->family)},
+ /* Interface id */
+ {&a_ifid_lo, sizeof(a_ifid_lo)},
+ {&one, sizeof(one)}};
msg.hdr.nlmsg_len = iov_length(iov, ARRAY_SIZE(iov));
fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
@@ -1131,7 +1135,7 @@ ERR_SOCKET:
* ip -6 neigh add proxy 1:2::2 dev hicnc-cons-eth0 2>&1 | grep nei
*
*/
-int _nl_add_neigh_proxy(const ip_prefix_t *prefix,
+int _nl_add_neigh_proxy(const hicn_ip_prefix_t *prefix,
const uint32_t interface_id) {
/* Buffer for holding the response, with appropriate casting on the header */
char buffer[BUFSIZE];
@@ -1156,9 +1160,11 @@ int _nl_add_neigh_proxy(const ip_prefix_t *prefix,
};
/* Message attributes = length/type/value */
- struct rtattr a_dst = {RTA_LENGTH(ip_address_len(prefix->family)), NDA_DST};
+ struct rtattr a_dst = {RTA_LENGTH(hicn_ip_address_len(prefix->family)),
+ NDA_DST};
- const void *address = ip_address_get_buffer(&prefix->address, prefix->family);
+ const void *address =
+ hicn_ip_address_get_buffer(&prefix->address, prefix->family);
if (!address) goto ERR;
/* Iovec describing the packets */
@@ -1166,7 +1172,7 @@ int _nl_add_neigh_proxy(const ip_prefix_t *prefix,
{&msg, sizeof(msg)},
/* Ip address */
{&a_dst, sizeof(a_dst)},
- {(void *)address, ip_address_len(prefix->family)},
+ {(void *)address, hicn_ip_address_len(prefix->family)},
};
msg.hdr.nlmsg_len = iov_length(iov, ARRAY_SIZE(iov));
@@ -1204,7 +1210,7 @@ ERR:
/* ip -6 route add 0:1::/64 dev hicn-if0 table 100 */
/* ip -6 route add 0:2::/64 dev hicn-if1 table 100 */
-int _nl_add_in_route_table(const ip_prefix_t *prefix,
+int _nl_add_in_route_table(const hicn_ip_prefix_t *prefix,
const uint32_t interface_id,
const uint8_t table_id) {
/* Buffer for holding the response, with appropriate casting on the header */
@@ -1236,10 +1242,12 @@ int _nl_add_in_route_table(const ip_prefix_t *prefix,
};
/* Message attributes = length/type/value */
- struct rtattr a_dst = {RTA_LENGTH(ip_address_len(prefix->family)), RTA_DST};
+ struct rtattr a_dst = {RTA_LENGTH(hicn_ip_address_len(prefix->family)),
+ RTA_DST};
struct rtattr a_oif = {RTA_LENGTH(sizeof(uint32_t)), RTA_OIF};
- const void *address = ip_address_get_buffer(&prefix->address, prefix->family);
+ const void *address =
+ hicn_ip_address_get_buffer(&prefix->address, prefix->family);
if (!address) goto ERR;
/* Iovec describing the packets */
@@ -1247,7 +1255,7 @@ int _nl_add_in_route_table(const ip_prefix_t *prefix,
{&msg, sizeof(msg)},
/* Destination prefix / ip address */
{&a_dst, sizeof(a_dst)},
- {(void *)address, ip_address_len(prefix->family)},
+ {(void *)address, hicn_ip_address_len(prefix->family)},
/* Output interface */
{&a_oif, sizeof(a_oif)},
{(void *)&interface_id, sizeof(uint32_t)},
@@ -1291,9 +1299,9 @@ ERR:
int _nl_add_in_route_table_s(const char *prefix, const uint32_t interface_id,
const uint8_t table_id) {
int rc;
- ip_prefix_t ip_address;
+ hicn_ip_prefix_t ip_address;
- rc = ip_prefix_pton(prefix, &ip_address);
+ rc = hicn_ip_prefix_pton(prefix, &ip_address);
if (rc < 0) {
return rc;
}
@@ -1306,7 +1314,7 @@ int _nl_add_in_route_s(const char *prefix, const uint32_t interface_id) {
}
/* ip -6 rule add from b001::/16 prio 0 table 100 */
-int _nl_add_prio_rule(const ip_prefix_t *prefix, uint8_t address_family,
+int _nl_add_prio_rule(const hicn_ip_prefix_t *prefix, uint8_t address_family,
const uint32_t priority, const uint8_t table_id) {
/* Buffer for holding the response, with appropriate casting on the header */
char buffer[BUFSIZE];
@@ -1341,18 +1349,19 @@ int _nl_add_prio_rule(const ip_prefix_t *prefix, uint8_t address_family,
if (prefix) {
/* Message attributes = length/type/value */
- struct rtattr a_src = {RTA_LENGTH(ip_address_len(prefix->family)), FRA_SRC};
+ struct rtattr a_src = {RTA_LENGTH(hicn_ip_address_len(prefix->family)),
+ FRA_SRC};
struct rtattr a_prio = {RTA_LENGTH(sizeof(uint32_t)), FRA_PRIORITY};
const void *address =
- ip_address_get_buffer(&prefix->address, prefix->family);
+ hicn_ip_address_get_buffer(&prefix->address, prefix->family);
if (!address) goto ERR;
/* Iovec describing the packets */
const struct iovec iov[] = {
{&msg, sizeof(msg)},
/* Source prefix / prefix */
{&a_src, sizeof(a_src)},
- {(void *)address, ip_address_len(prefix->family)},
+ {(void *)address, hicn_ip_address_len(prefix->family)},
/* Priority */
{&a_prio, sizeof(a_prio)},
{(void *)&priority, sizeof(uint32_t)},
@@ -1403,13 +1412,13 @@ ERR:
return HICN_SOCKET_ERROR_UNSPEC;
}
-int _nl_add_lo_prio_rule(const ip_prefix_t *prefix, uint8_t address_family,
+int _nl_add_lo_prio_rule(const hicn_ip_prefix_t *prefix, uint8_t address_family,
const uint32_t priority) {
return _nl_add_prio_rule(prefix, address_family, priority, RT_TABLE_LOCAL);
}
/* ip -6 rule del from all prio 0 table local */
-int _nl_del_prio_rule(const ip_prefix_t *prefix, uint8_t address_family,
+int _nl_del_prio_rule(const hicn_ip_prefix_t *prefix, uint8_t address_family,
const uint32_t priority, const uint8_t table_id) {
/* Buffer for holding the response, with appropriate casting on the header */
char buffer[BUFSIZE];
@@ -1444,11 +1453,12 @@ int _nl_del_prio_rule(const ip_prefix_t *prefix, uint8_t address_family,
/* Message attributes = length/type/value */
if (prefix) {
- struct rtattr a_src = {RTA_LENGTH(ip_address_len(prefix->family)), FRA_SRC};
+ struct rtattr a_src = {RTA_LENGTH(hicn_ip_address_len(prefix->family)),
+ FRA_SRC};
struct rtattr a_prio = {RTA_LENGTH(sizeof(uint32_t)), FRA_PRIORITY};
const void *address =
- ip_address_get_buffer(&prefix->address, prefix->family);
+ hicn_ip_address_get_buffer(&prefix->address, prefix->family);
if (!address) goto ERR;
/* Iovec describing the packets */
@@ -1456,7 +1466,7 @@ int _nl_del_prio_rule(const ip_prefix_t *prefix, uint8_t address_family,
{&msg, sizeof(msg)},
/* Source prefix / prefix */
{&a_src, sizeof(a_src)},
- {(void *)address, ip_address_len(prefix->family)},
+ {(void *)address, hicn_ip_address_len(prefix->family)},
/* Priority */
{&a_prio, sizeof(a_prio)},
{(void *)&priority, sizeof(uint32_t)},
@@ -1509,8 +1519,8 @@ ERR:
return HICN_SOCKET_ERROR_UNSPEC;
}
-int _nl_del_lo_prio_rule(const ip_prefix_t *ip_address, uint8_t address_family,
- const uint32_t priority) {
+int _nl_del_lo_prio_rule(const hicn_ip_prefix_t *ip_address,
+ uint8_t address_family, const uint32_t priority) {
return _nl_del_prio_rule(ip_address, address_family, priority,
RT_TABLE_LOCAL);
}