diff options
author | Sander Vrijders <[email protected]> | 2016-06-05 16:49:32 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-06-14 14:05:28 +0200 |
commit | aeb53fcd725fe291afa6ffb683373c8e589afa64 (patch) | |
tree | 3f9840107501dc98472406dadfa16eba860ca61b /src/tools | |
parent | a76b638a370cd0cdd087ec780e6b1f8d18bac66d (diff) | |
download | ouroboros-aeb53fcd725fe291afa6ffb683373c8e589afa64.tar.gz ouroboros-aeb53fcd725fe291afa6ffb683373c8e589afa64.zip |
ipcpd: Adds a shim over IEEE 802.2 over IEEE 802.3
This adds a shim over LLC over Ethernet. It uses the raw socket API to
send messages directly over an interface.
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/irm/irm_bootstrap_ipcp.c | 18 | ||||
-rw-r--r-- | src/tools/irm/irm_create_ipcp.c | 6 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src/tools/irm/irm_bootstrap_ipcp.c b/src/tools/irm/irm_bootstrap_ipcp.c index 5cf5f017..e11b5f3f 100644 --- a/src/tools/irm/irm_bootstrap_ipcp.c +++ b/src/tools/irm/irm_bootstrap_ipcp.c @@ -33,6 +33,7 @@ #define NORMAL "normal" #define SHIM_UDP "shim-udp" +#define SHIM_ETH_LLC "shim-eth-llc" #define LOCAL "local" #define DEFAULT_ADDR_SIZE 4 @@ -54,7 +55,8 @@ static void usage() " [api <application process instance>]\n" " dif <DIF name>\n" " type [TYPE]\n\n" - "where TYPE = {" NORMAL " " LOCAL " " SHIM_UDP "}\n\n" + "where TYPE = {" NORMAL " " LOCAL " " + SHIM_UDP " " SHIM_ETH_LLC"}\n\n" "if TYPE == " NORMAL "\n" " [addr <address size> (default: %d)]\n" " [cep_id <CEP-id size> (default: %d)]\n" @@ -68,7 +70,9 @@ static void usage() "if TYPE == " SHIM_UDP "\n" " ip <IP address in dotted notation>\n" " [dns <DDNS IP address in dotted notation>" - " (default = none: %d)]\n", + " (default = none: %d)]\n" + "if TYPE == " SHIM_ETH_LLC "\n" + " if_name <interface name>\n", DEFAULT_ADDR_SIZE, DEFAULT_CEP_ID_SIZE, DEFAULT_PDU_LEN_SIZE, DEFAULT_QOS_ID_SIZE, DEFAULT_SEQ_NO_SIZE, DEFAULT_TTL_SIZE, @@ -93,6 +97,7 @@ int do_bootstrap_ipcp(int argc, char ** argv) uint32_t dns_addr = DEFAULT_DDNS; char * ipcp_type = NULL; char * dif_name = NULL; + char * if_name = NULL; while (argc > 0) { if (matches(*argv, "type") == 0) { @@ -113,6 +118,8 @@ int do_bootstrap_ipcp(int argc, char ** argv) usage(); return -1; } + } else if (matches(*argv, "if_name") == 0) { + if_name = *(argv + 1); } else if (matches(*argv, "addr") == 0) { addr_size = atoi(*(argv + 1)); } else if (matches(*argv, "cep_id") == 0) { @@ -169,6 +176,13 @@ int do_bootstrap_ipcp(int argc, char ** argv) conf.dns_addr = dns_addr; } else if (strcmp(ipcp_type, LOCAL) == 0) { conf.type = IPCP_LOCAL; + } else if (strcmp(ipcp_type, SHIM_ETH_LLC) == 0) { + conf.type = IPCP_SHIM_ETH_LLC; + if (if_name == NULL) { + usage(); + return -1; + } + conf.if_name = if_name; } else { usage(); return -1; diff --git a/src/tools/irm/irm_create_ipcp.c b/src/tools/irm/irm_create_ipcp.c index 21438bd4..cb957d94 100644 --- a/src/tools/irm/irm_create_ipcp.c +++ b/src/tools/irm/irm_create_ipcp.c @@ -34,6 +34,7 @@ #define NORMAL "normal" #define SHIM_UDP "shim-udp" +#define SHIM_ETH_LLC "shim-eth-llc" #define LOCAL "local" static void usage() @@ -41,7 +42,8 @@ static void usage() printf("Usage: irm create_ipcp\n" " ap <application process name>\n" " type [TYPE]\n\n" - "where TYPE = {" NORMAL " " LOCAL " " SHIM_UDP "}\n"); + "where TYPE = {" NORMAL " " LOCAL " " + SHIM_UDP " " SHIM_ETH_LLC "}\n"); } int do_create_ipcp(int argc, char ** argv) @@ -76,6 +78,8 @@ int do_create_ipcp(int argc, char ** argv) type = IPCP_SHIM_UDP; else if (strcmp(ipcp_type, LOCAL) == 0) type = IPCP_LOCAL; + else if (strcmp(ipcp_type, SHIM_ETH_LLC) == 0) + type = IPCP_SHIM_ETH_LLC; else { usage(); return -1; |