2 * Distributed under the terms of the GNU GPL version 2.
3 * Copyright (c) 2008 Nicira Networks
11 /* The following vendor extensions, proposed by Nicira Networks, are not yet
12 * ready for standardization (and may never be), so they are not included in
15 #define NX_VENDOR_ID 0x00002320
18 /* Switch status request. The request body is an ASCII string that
19 * specifies a prefix of the key names to include in the output; if it is
20 * the null string, then all key-value pairs are included. */
23 /* Switch status reply. The reply body is an ASCII string of key-value
24 * pairs in the form "key=value\n". */
27 /* Configure an action. Most actions do not require configuration
28 * beyond that supplied in the actual action call. */
31 /* Get configuration of action. */
35 struct nicira_header {
36 struct ofp_header header;
37 uint32_t vendor; /* NX_VENDOR_ID. */
38 uint32_t subtype; /* One of NXT_* above. */
40 OFP_ASSERT(sizeof(struct nicira_header) == sizeof(struct ofp_vendor_header) + 4);
43 enum nx_snat_command {
48 /* Configuration for source-NATing */
49 struct nx_snat_config {
50 uint8_t command; /* One of NXSC_*. */
52 uint16_t port; /* Physical switch port. */
53 uint16_t mac_timeout; /* Time to cache MAC addresses of SNAT'd hosts
54 in seconds. 0 uses the default value. */
56 /* Range of IP addresses to impersonate. Set both values to the
57 * same to support a single address. */
58 uint32_t ip_addr_start;
61 /* Range of transport ports that should be used as new source port. A
62 * value of zero, let's the switch choose.*/
68 OFP_ASSERT(sizeof(struct nx_snat_config) == 24);
70 /* Action configuration. Not all actions require separate configuration. */
71 struct nx_act_config {
72 struct nicira_header header;
73 uint16_t type; /* One of OFPAT_* */
76 struct nx_snat_config snat[0];
77 }; /* Array of action configurations. The number
78 is inferred from the length field in the
81 OFP_ASSERT(sizeof(struct nx_act_config) == 20);
84 enum nx_action_subtype {
85 NXAST_SNAT /* Source-NAT */
88 /* Action structure for NXAST_SNAT. */
89 struct nx_action_snat {
90 uint16_t type; /* OFPAT_VENDOR. */
91 uint16_t len; /* Length is 8. */
92 uint32_t vendor; /* NX_VENDOR_ID. */
93 uint16_t subtype; /* NXAST_SNAT. */
94 uint16_t port; /* Output port--it must be previously
98 OFP_ASSERT(sizeof(struct nx_action_snat) == 16);
100 /* Header for Nicira-defined actions. */
101 struct nx_action_header {
102 uint16_t type; /* OFPAT_VENDOR. */
103 uint16_t len; /* Length is 8. */
104 uint32_t vendor; /* NX_VENDOR_ID. */
105 uint16_t subtype; /* NXAST_*. */
108 OFP_ASSERT(sizeof(struct nx_action_header) == 16);
110 #endif /* nicira-ext.h */