diff options
author | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2021-06-24 09:15:41 +0200 |
---|---|---|
committer | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2021-06-24 09:15:41 +0200 |
commit | 229385955109b866a23c4ac2aa03d4d11044c39d (patch) | |
tree | 0591f9c2fc4144d62330337cc2b94c63dfeded54 /ctrl/libhicnctrl/includes | |
parent | 6ffbb5ed61733b8dbef39b1a9d437e899e9359d7 (diff) |
[HICN-708] Rebase with master
Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com>
Change-Id: I2122e1d61dd3b2e039972624ffbdbcb3c5610159
Diffstat (limited to 'ctrl/libhicnctrl/includes')
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/api.h | 5 | ||||
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/commands.h | 97 |
2 files changed, 16 insertions, 86 deletions
diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h index 3771b3abd..ebb4ee007 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Cisco and/or its affiliates. + * Copyright (c) 2017-2020 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -636,6 +636,7 @@ typedef struct { ip_address_t remote_addr; /* krw */ u8 len; /* krw */ u16 cost; /* .rw */ + // XXX hc_face_t face; } hc_route_t; int hc_route_parse(void *in, hc_route_t *route); @@ -743,7 +744,7 @@ typedef struct { int family; /* Krw */ ip_address_t remote_addr; /* krw */ u8 len; /* krw */ - policy_t policy; /* .rw */ + hicn_policy_t policy; /* .rw */ } hc_policy_t; int hc_policy_parse(void *in, hc_policy_t *policy); diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/commands.h b/ctrl/libhicnctrl/includes/hicn/ctrl/commands.h index 767ef98a3..472c237b4 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/commands.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/commands.h @@ -20,8 +20,8 @@ * Header and payload in binary format. */ -#ifndef commands_h -#define commands_h +#ifndef HICN_CTRL_COMMANDS_H +#define HICN_CTRL_COMMANDS_H #ifndef _WIN32 #include <netinet/in.h> @@ -31,31 +31,14 @@ #include <stdint.h> #include <stdlib.h> -#include <hicn/util/ip_address.h> #ifdef WITH_POLICY #include <hicn/policy.h> #endif /* WITH_POLICY */ +#include <hicn/strategy.h> +#include <hicn/util/ip_address.h> -#define SYMBOLIC_NAME_LEN 16 -#define MAX_FWD_STRATEGY_RELATED_PREFIXES 10 - -typedef struct in6_addr ipv6_addr_t; -typedef uint32_t ipv4_addr_t; - -typedef enum { - ADDR_INET = 1, - ADDR_INET6, - ADDR_LINK, - ADDR_IFACE, - ADDR_UNIX /* PF_UNIX */ -} address_type; -typedef enum { - UDP_CONN, - TCP_CONN, - GRE_CONN, // not implemented - HICN_CONN -} connection_type; +#define SYMBOLIC_NAME_LEN 16 typedef struct in6_addr ipv6_addr_t; typedef uint32_t ipv4_addr_t; @@ -118,14 +101,12 @@ typedef enum { #define command_type_from_uchar(x) \ (((x) >= COMMAND_TYPE_N) ? COMMAND_TYPE_N : (command_type_t)(x)) -/* Header */ - /* Should be at least 8 bytes */ typedef struct { - uint8_t messageType; - uint8_t commandID ; + uint8_t message_type; + uint8_t command_id; uint16_t length; /* Number of structures in the payload */ - uint32_t seqNum; + uint32_t seq_num; } cmd_header_t; typedef struct { @@ -134,19 +115,13 @@ typedef struct { /* Listener */ -typedef enum { ETHER_MODE, IP_MODE, HICN_MODE } listener_mode; - typedef struct { char symbolic[SYMBOLIC_NAME_LEN]; - char interfaceName[SYMBOLIC_NAME_LEN]; + char interface_name[SYMBOLIC_NAME_LEN]; ip_address_t address; uint16_t port; - // uint16_t etherType; - uint8_t addressType; - uint8_t listenerMode; - uint8_t connectionType; uint8_t family; - uint8_t listenerType; + uint8_t type; } cmd_listener_add_t; typedef struct { @@ -154,13 +129,6 @@ typedef struct { } cmd_listener_remove_t; typedef struct { - ip_address_t address; - char listenerName[SYMBOLIC_NAME_LEN]; - char interfaceName[SYMBOLIC_NAME_LEN]; - uint32_t connid; - uint16_t port; - uint8_t addressType; - uint8_t encapType; } cmd_listener_list_t; typedef struct { @@ -184,7 +152,6 @@ typedef struct { uint16_t local_port; uint8_t family; uint8_t type; - uint8_t connection_type; uint8_t admin_state; #ifdef WITH_POLICY uint32_t priority; @@ -196,27 +163,7 @@ typedef struct { char symbolicOrConnid[SYMBOLIC_NAME_LEN]; } cmd_connection_remove_t; -typedef enum { - CONN_GRE, - CONN_TCP, - CONN_UDP, - CONN_MULTICAST, - CONN_L2, - CONN_HICN -} list_connections_type; - -typedef enum { - IFACE_UP = 0, - IFACE_DOWN = 1, - IFACE_UNKNOWN = 2 // not used actually -} connection_state; - typedef struct { - cmd_connection_add_t connectionData; - uint32_t connid; - uint8_t state; - char interfaceName[SYMBOLIC_NAME_LEN]; - char connectionName[SYMBOLIC_NAME_LEN]; } cmd_connection_list_t; typedef struct { @@ -236,7 +183,7 @@ typedef struct { uint32_t id; uint8_t state; char interface_name[SYMBOLIC_NAME_LEN]; - char name[SYMBOLIC_NAME_LEN]; + char name[SYMBOLIC_NAME_LEN]; // XXX what is this ? } cmd_connection_list_item_t; typedef struct { @@ -268,7 +215,6 @@ typedef struct { char symbolicOrConnid[SYMBOLIC_NAME_LEN]; ip_address_t address; uint16_t cost; - uint8_t addressType; uint8_t family; uint8_t len; } cmd_route_add_t; @@ -276,17 +222,11 @@ typedef struct { typedef struct { char symbolicOrConnid[SYMBOLIC_NAME_LEN]; ip_address_t address; - uint8_t addressType; uint8_t family; uint8_t len; } cmd_route_remove_t; typedef struct { - ip_address_t address; - uint32_t connid; - uint16_t cost; - uint8_t addressType; - uint8_t len; } cmd_route_list_t; typedef struct { @@ -322,7 +262,6 @@ typedef struct { typedef struct { ip_address_t address; uint8_t strategy_type; - uint8_t address_type; uint8_t family; uint8_t len; uint8_t related_prefixes; @@ -340,7 +279,6 @@ typedef struct { typedef struct { char symbolicOrConnid[SYMBOLIC_NAME_LEN]; ip_address_t address; - uint8_t addressType; uint8_t family; uint8_t len; } cmd_punting_add_t; @@ -367,40 +305,31 @@ typedef struct { uint8_t len; } cmd_mapme_send_update_t; -#ifdef WITH_POLICY /* Policy */ typedef struct { ip_address_t address; - uint8_t addressType; uint8_t family; uint8_t len; - policy_t policy; + hicn_policy_t policy; } cmd_policy_add_t; typedef struct { ip_address_t address; - uint8_t addressType; uint8_t family; uint8_t len; } cmd_policy_remove_t; typedef struct { - ip_address_t address; - uint8_t addressType; - uint8_t len; - policy_t policy; } cmd_policy_list_t; typedef struct { ip_address_t address; uint8_t family; uint8_t len; - policy_t policy; + hicn_policy_t policy; } cmd_policy_list_item_t; -#endif /* WITH_POLICY */ - /* Full messages */ #define _(l, u) \ |