summaryrefslogtreecommitdiffstats
path: root/hicn-light/src/socket/ops.h
diff options
context:
space:
mode:
authorLuca Muscariello <lumuscar+fdio@cisco.com>2019-01-17 13:47:57 +0100
committerLuca Muscariello <lumuscar+fdio@cisco.com>2019-01-17 16:32:51 +0100
commitbac3da61644515f05663789b122554dc77549286 (patch)
tree898210bc8e70371d77de7d446a26c5dd4fd1165a /hicn-light/src/socket/ops.h
parentd5165246787301d0f13b646fda5e8a8567aef5ac (diff)
This is the first commit of the hicn projectv19.01
Change-Id: I6f2544ad9b9f8891c88cc4bcce3cf19bd3cc863f Signed-off-by: Luca Muscariello <lumuscar+fdio@cisco.com>
Diffstat (limited to 'hicn-light/src/socket/ops.h')
-rwxr-xr-xhicn-light/src/socket/ops.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/hicn-light/src/socket/ops.h b/hicn-light/src/socket/ops.h
new file mode 100755
index 000000000..249caf87a
--- /dev/null
+++ b/hicn-light/src/socket/ops.h
@@ -0,0 +1,54 @@
+#ifndef HICN_SOCKET_OPS_H
+#define HICN_SOCKET_OPS_H
+
+#include <hicn/hicn.h>
+#include <stdint.h>
+
+typedef struct {
+ char *arch;
+ int (*tun_create)(char *name);
+ int (*get_tun_name)(const char *prefix, const char *identifier,
+ char *tun_name);
+ int (*enable_v6_forwarding)(char *interface_name);
+ int (*enable_v4_forwarding)();
+ int (*enable_ndp_proxy)();
+
+ uint32_t (*get_ifid)(const char *ifname);
+ 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_address_t *ip_address);
+ int (*set_ip_addr)(uint32_t interface_id, ip_address_t *ip_address);
+ int (*up_if)(uint32_t interface_id);
+ int (*add_in_route_table)(const ip_address_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,
+ const uint8_t table_id);
+ int (*add_in_route_s)(const char *prefix, const uint32_t interface_id);
+ int (*add_out_route)(const char *gateway, const uint8_t address_family,
+ 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_address_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_address_t *ip_address,
+ const uint32_t interface_id);
+ int (*add_prio_rule)(const ip_address_t *ip_address,
+ const uint8_t address_family, const uint32_t priority,
+ const uint8_t table_id);
+ int (*add_lo_prio_rule)(const ip_address_t *ip_address,
+ const uint8_t address_family,
+ const uint32_t priority);
+ int (*del_prio_rule)(const ip_address_t *ip_address,
+ const uint8_t address_family, const uint32_t priority,
+ const uint8_t table_id);
+ int (*del_lo_prio_rule)(const ip_address_t *ip_address,
+ const uint8_t address_family,
+ const uint32_t priority);
+} hicn_socket_ops_t;
+
+#endif /* HICN_SOCKET_OPS_H */