diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2025-08-17 12:09:12 +0200 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2025-09-10 08:19:52 +0200 |
commit | 5274cb3ce09c40cccd29ec771ad49a2069aa37c4 (patch) | |
tree | 634d94ede018b6c108a85e30e5f29f1725bf6100 /src/ipcpd/shim-data.h | |
parent | f2a6a1c302a5e962c61857ed4a2f03bd5991b41c (diff) | |
download | ouroboros-5274cb3ce09c40cccd29ec771ad49a2069aa37c4.tar.gz ouroboros-5274cb3ce09c40cccd29ec771ad49a2069aa37c4.zip |
ipcpd: Add ipcpd over UDP/IPv6
This adds an IPCP that runs over UDP/IPv6. It's structured like the
eth-dix and eth-llc in that it builds two separate binaries:
ipcpd-udp4 and ipcpd-udp6. The IRM CLI is backwards compatible in that
type 'udp' will resolve to type 'udp4'.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/shim-data.h')
-rw-r--r-- | src/ipcpd/shim-data.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ipcpd/shim-data.h b/src/ipcpd/shim-data.h index 372b4ea7..ea4ce413 100644 --- a/src/ipcpd/shim-data.h +++ b/src/ipcpd/shim-data.h @@ -25,9 +25,12 @@ #include <ouroboros/list.h> -#include <sys/types.h> #include <pthread.h> #include <stdint.h> +#include <netinet/in.h> +#include <sys/types.h> + +#define MAC_SIZE 6 enum dir_query_state { QUERY_INIT = 0, @@ -46,6 +49,14 @@ struct dir_query { pthread_cond_t cond; }; +struct addr { + union { + uint8_t mac[MAC_SIZE]; + struct in_addr ip4; + struct in6_addr ip6; + }; +}; + struct shim_data { struct list_head registry; pthread_rwlock_t reg_lock; @@ -72,16 +83,16 @@ bool shim_data_reg_has(struct shim_data * data, int shim_data_dir_add_entry(struct shim_data * data, const uint8_t * hash, - uint64_t addr); + struct addr addr); int shim_data_dir_del_entry(struct shim_data * data, const uint8_t * hash, - uint64_t addr); + struct addr addr); bool shim_data_dir_has(struct shim_data * data, const uint8_t * hash); -uint64_t shim_data_dir_get_addr(struct shim_data * data, +struct addr shim_data_dir_get_addr(struct shim_data * data, const uint8_t * hash); struct dir_query * shim_data_dir_query_create(struct shim_data * data, |