diff options
-rw-r--r-- | openflow.h | 11 | ||||
-rw-r--r-- | oui.c | 9 | ||||
-rw-r--r-- | oui.h | 9 | ||||
-rw-r--r-- | print-openflow-1.0.c | 5 | ||||
-rw-r--r-- | print-openflow.c | 19 | ||||
-rw-r--r-- | tests/of10_7050q-v.out | 8 | ||||
-rw-r--r-- | tests/of10_p3295-vv.out | 2 |
7 files changed, 57 insertions, 6 deletions
@@ -32,9 +32,20 @@ #define OF_HEADER_LEN 8 +#define ONF_EXP_ONF 0x4f4e4600 +#define ONF_EXP_BUTE 0xff000001 +#define ONF_EXP_NOVIFLOW 0xff000002 +#define ONF_EXP_L3 0xff000003 +#define ONF_EXP_L4L7 0xff000004 +#define ONF_EXP_WMOB 0xff000005 +#define ONF_EXP_FABS 0xff000006 +#define ONF_EXP_OTRANS 0xff000007 +extern const struct tok onf_exp_str[]; + /* * Routines to print packets for various versions of OpenFlow. */ extern const u_char *of10_header_body_print(netdissect_options *ndo, const u_char *, const u_char *, const uint8_t, const uint16_t, const uint32_t); +extern const char * of_vendor_name(const uint32_t); @@ -39,6 +39,15 @@ const struct tok oui_values[] = { { OUI_IEEE_8023_PRIVATE, "IEEE 802.3 Private"}, { OUI_TIA, "ANSI/TIA"}, { OUI_DCBX, "DCBX"}, + { OUI_NICIRA, "Nicira Networks" }, + { OUI_BSN, "Big Switch Networks" }, + { OUI_VELLO, "Vello Systems" }, + { OUI_HP2, "HP" }, + { OUI_HPLABS, "HP-Labs" }, + { OUI_INFOBLOX, "Infoblox Inc" }, + { OUI_ONLAB, "Open Networking Lab" }, + { OUI_FREESCALE, "Freescale" }, + { OUI_NETRONOME, "Netronome" }, { 0, NULL } }; @@ -30,6 +30,15 @@ extern const struct tok smi_values[]; #define OUI_IEEE_8023_PRIVATE 0x00120f /* IEEE 802.3 Organisation Specific - Annex G */ #define OUI_TIA 0x0012bb /* TIA - Telecommunications Industry Association - ANSI/TIA-1057- 2006 */ #define OUI_DCBX 0x001B21 /* DCBX */ +#define OUI_NICIRA 0x002320 /* Nicira Networks */ +#define OUI_BSN 0x5c16c7 /* Big Switch Networks */ +#define OUI_VELLO 0xb0d2f5 /* Vello Systems */ +#define OUI_HP2 0x002481 /* HP too */ +#define OUI_HPLABS 0x0004ea /* HP-Labs */ +#define OUI_INFOBLOX 0x748771 /* Infoblox Inc */ +#define OUI_ONLAB 0xa42305 /* Open Networking Lab */ +#define OUI_FREESCALE 0x00049f /* Freescale */ +#define OUI_NETRONOME 0x0015ad /* Netronome */ /* * These are SMI Network Management Private Enterprise Codes for diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c index a26f2dc0..1bb11a66 100644 --- a/print-openflow-1.0.c +++ b/print-openflow-1.0.c @@ -637,12 +637,15 @@ trunc: static const u_char * of10_vendor_data_print(netdissect_options *ndo, const u_char *cp, const u_char *ep, const u_int len) { + uint32_t vendor; + if (len < 4) goto corrupt; /* vendor */ ND_TCHECK2(*cp, 4); - ND_PRINT((ndo, ", vendor 0x%08x", EXTRACT_32BITS(cp))); + vendor = EXTRACT_32BITS(cp); cp += 4; + ND_PRINT((ndo, ", vendor 0x%08x (%s)", vendor, of_vendor_name(vendor))); /* data */ return of10_data_print(ndo, cp, ep, len - 4); diff --git a/print-openflow.c b/print-openflow.c index 9a675855..d7682a0e 100644 --- a/print-openflow.c +++ b/print-openflow.c @@ -40,12 +40,31 @@ #include "interface.h" #include "extract.h" #include "openflow.h" +#include "oui.h" static const char tstr[] = " [|openflow]"; static const char cstr[] = " (corrupt)"; #define OF_VER_1_0 0x01 +const struct tok onf_exp_str[] = { + { ONF_EXP_ONF, "ONF Extensions" }, + { ONF_EXP_BUTE, "Budapest University of Technology and Economics" }, + { ONF_EXP_NOVIFLOW, "NoviFlow" }, + { ONF_EXP_L3, "L3+ Extensions, Vendor Neutral" }, + { ONF_EXP_L4L7, "L4-L7 Extensions" }, + { ONF_EXP_WMOB, "Wireless and Mobility Extensions" }, + { ONF_EXP_FABS, "Forwarding Abstractions Extensions" }, + { ONF_EXP_OTRANS, "Optical Transport Extensions" }, + { 0, NULL } +}; + +const char * +of_vendor_name(const uint32_t vendor) { + const struct tok *table = (vendor & 0xff000000) == 0 ? oui_values : onf_exp_str; + return tok2str(table, "unknown", vendor); +} + static void of_header_print(netdissect_options *ndo, const uint8_t version, const uint8_t type, const uint16_t length, const uint32_t xid) { diff --git a/tests/of10_7050q-v.out b/tests/of10_7050q-v.out index faa8045d..dc696e16 100644 --- a/tests/of10_7050q-v.out +++ b/tests/of10_7050q-v.out @@ -1,18 +1,18 @@ IP (tos 0x0, ttl 64, id 53965, offset 0, flags [DF], proto TCP (6), length 104) 10.0.0.80.6633 > 86.139.225.177.57145: Flags [P.], cksum 0xddb3 (correct), seq 3804035784:3804035836, ack 3936946676, win 136, options [nop,nop,TS val 256259488 ecr 12980962], length 52: OpenFlow - version 1.0, type VENDOR, length 24, xid 0x00000018, vendor 0x005c16c7 + version 1.0, type VENDOR, length 24, xid 0x00000018, vendor 0x005c16c7 (Big Switch Networks) data (12 octets) - version 1.0, type VENDOR, length 20, xid 0x00000019, vendor 0x005c16c7 + version 1.0, type VENDOR, length 20, xid 0x00000019, vendor 0x005c16c7 (Big Switch Networks) data (8 octets) version 1.0, type BARRIER_REQUEST, length 8, xid 0x0000001a IP (tos 0x0, ttl 44, id 2943, offset 0, flags [DF], proto TCP (6), length 76) 86.139.225.177.57145 > 10.0.0.80.6633: Flags [P.], cksum 0xf75f (correct), seq 1:25, ack 52, win 54, options [nop,nop,TS val 12980987 ecr 256259488], length 24: OpenFlow - version 1.0, type VENDOR, length 24, xid 0x00000018, vendor 0x005c16c7 + version 1.0, type VENDOR, length 24, xid 0x00000018, vendor 0x005c16c7 (Big Switch Networks) data (12 octets) IP (tos 0x0, ttl 64, id 53966, offset 0, flags [DF], proto TCP (6), length 52) 10.0.0.80.6633 > 86.139.225.177.57145: Flags [.], cksum 0x42b3 (incorrect -> 0x0ee3), ack 25, win 136, options [nop,nop,TS val 256259628 ecr 12980987], length 0 IP (tos 0x0, ttl 44, id 2944, offset 0, flags [DF], proto TCP (6), length 80) 86.139.225.177.57145 > 10.0.0.80.6633: Flags [P.], cksum 0xf55e (correct), seq 25:53, ack 52, win 54, options [nop,nop,TS val 12981023 ecr 256259628], length 28: OpenFlow - version 1.0, type VENDOR, length 20, xid 0x00000019, vendor 0x005c16c7 + version 1.0, type VENDOR, length 20, xid 0x00000019, vendor 0x005c16c7 (Big Switch Networks) data (8 octets) version 1.0, type BARRIER_REPLY, length 8, xid 0x0000001a diff --git a/tests/of10_p3295-vv.out b/tests/of10_p3295-vv.out index 521bdd4e..7d1a6917 100644 --- a/tests/of10_p3295-vv.out +++ b/tests/of10_p3295-vv.out @@ -456,7 +456,7 @@ IP (tos 0x0, ttl 64, id 783, offset 0, flags [DF], proto TCP (6), length 1500) version 1.0, type FLOW_MOD, length 144, xid 0x00000010 match in_port 4 cookie 0x000000000000000b, command ADD, priority 54311, buffer_id NONE, flags 0x0001 (SEND_FLOW_REM) - action type VENDOR, len 72, vendor 0x00001234 + action type VENDOR, len 72, vendor 0x00001234 (unknown) data (64 octets) 0x0000: 4469 6420 796f 7520 6b6e 6f77 2076 656e Did.you.know.ven 0x0010: 646f 7220 6163 7469 6f6e 2064 6174 6120 dor.action.data. |