2 * Distributed under the terms of the GNU GPL version 2.
3 * Copyright (c) 2008, 2009 Nicira Networks
6 #ifndef OPENFLOW_NICIRA_EXT_H
7 #define OPENFLOW_NICIRA_EXT_H 1
9 #include "openflow/openflow.h"
11 #define NICIRA_OUI_STR "002320"
13 /* The following vendor extensions, proposed by Nicira Networks, are not yet
14 * ready for standardization (and may never be), so they are not included in
17 #define NX_VENDOR_ID 0x00002320
20 /* Switch status request. The request body is an ASCII string that
21 * specifies a prefix of the key names to include in the output; if it is
22 * the null string, then all key-value pairs are included. */
25 /* Switch status reply. The reply body is an ASCII string of key-value
26 * pairs in the form "key=value\n". */
29 /* Configure an action. Most actions do not require configuration
30 * beyond that supplied in the actual action call. */
33 /* Get configuration of action. */
36 /* Remote command execution. The request body is a sequence of strings
37 * delimited by null bytes. The first string is a command name.
38 * Subsequent strings are command arguments. */
41 /* Remote command execution reply, sent when the command's execution
42 * completes. The reply body is struct nx_command_reply. */
46 NXT_FLOW_END_CONFIG__OBSOLETE,
49 NXT_FLOW_END__OBSOLETE,
51 /* Management protocol. See "openflow-mgmt.h". */
55 struct nicira_header {
56 struct ofp_header header;
57 uint32_t vendor; /* NX_VENDOR_ID. */
58 uint32_t subtype; /* One of NXT_* above. */
60 OFP_ASSERT(sizeof(struct nicira_header) == sizeof(struct ofp_vendor_header) + 4);
63 enum nx_action_subtype {
64 NXAST_SNAT__OBSOLETE, /* No longer used. */
65 NXAST_RESUBMIT /* Throw against flow table again. */
68 /* Action structure for NXAST_RESUBMIT. */
69 struct nx_action_resubmit {
70 uint16_t type; /* OFPAT_VENDOR. */
71 uint16_t len; /* Length is 8. */
72 uint32_t vendor; /* NX_VENDOR_ID. */
73 uint16_t subtype; /* NXAST_RESUBMIT. */
74 uint16_t in_port; /* New in_port for checking flow table. */
77 OFP_ASSERT(sizeof(struct nx_action_resubmit) == 16);
79 /* Header for Nicira-defined actions. */
80 struct nx_action_header {
81 uint16_t type; /* OFPAT_VENDOR. */
82 uint16_t len; /* Length is 8. */
83 uint32_t vendor; /* NX_VENDOR_ID. */
84 uint16_t subtype; /* NXAST_*. */
87 OFP_ASSERT(sizeof(struct nx_action_header) == 16);
89 /* Status bits for NXT_COMMAND_REPLY. */
91 NXT_STATUS_EXITED = 1 << 31, /* Exited normally. */
92 NXT_STATUS_SIGNALED = 1 << 30, /* Exited due to signal. */
93 NXT_STATUS_UNKNOWN = 1 << 29, /* Exited for unknown reason. */
94 NXT_STATUS_COREDUMP = 1 << 28, /* Exited with core dump. */
95 NXT_STATUS_ERROR = 1 << 27, /* Command could not be executed. */
96 NXT_STATUS_STARTED = 1 << 26, /* Command was started. */
97 NXT_STATUS_EXITSTATUS = 0xff, /* Exit code mask if NXT_STATUS_EXITED. */
98 NXT_STATUS_TERMSIG = 0xff, /* Signal number if NXT_STATUS_SIGNALED. */
101 /* NXT_COMMAND_REPLY. */
102 struct nx_command_reply {
103 struct nicira_header nxh;
104 uint32_t status; /* Status bits defined above. */
105 /* Followed by any number of bytes of process output. */
107 OFP_ASSERT(sizeof(struct nx_command_reply) == 20);
109 #endif /* openflow/nicira-ext.h */