projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sflow: Use hash table instead of sparse array for sflow ports.
[openvswitch]
/
lib
/
ofp-parse.c
diff --git
a/lib/ofp-parse.c
b/lib/ofp-parse.c
index cc1419a0eb2ad9e34df0818d34e7f974151f759b..312eaaaaff1842d9583a7892313a088a533de5f7 100644
(file)
--- a/
lib/ofp-parse.c
+++ b/
lib/ofp-parse.c
@@
-33,8
+33,6
@@
VLOG_DEFINE_THIS_MODULE(ofp_parse)
VLOG_DEFINE_THIS_MODULE(ofp_parse)
-#define DEFAULT_IDLE_TIMEOUT 60
-
static uint32_t
str_to_u32(const char *str)
{
static uint32_t
str_to_u32(const char *str)
{
@@
-263,16
+261,21
@@
str_to_action(char *str, struct ofpbuf *b)
nast->vendor = htonl(NX_VENDOR_ID);
nast->subtype = htons(NXAST_SET_TUNNEL);
nast->tun_id = htonl(str_to_u32(arg));
nast->vendor = htonl(NX_VENDOR_ID);
nast->subtype = htons(NXAST_SET_TUNNEL);
nast->tun_id = htonl(str_to_u32(arg));
+ } else if (!strcasecmp(act, "drop_spoofed_arp")) {
+ struct nx_action_header *nah;
+ nah = put_action(b, sizeof *nah, OFPAT_VENDOR);
+ nah->vendor = htonl(NX_VENDOR_ID);
+ nah->subtype = htons(NXAST_DROP_SPOOFED_ARP);
} else if (!strcasecmp(act, "output")) {
put_output_action(b, str_to_u32(arg));
} else if (!strcasecmp(act, "enqueue")) {
char *sp = NULL;
} else if (!strcasecmp(act, "output")) {
put_output_action(b, str_to_u32(arg));
} else if (!strcasecmp(act, "enqueue")) {
char *sp = NULL;
- char *port = strtok_r(arg, ":q", &sp);
+ char *port
_s
= strtok_r(arg, ":q", &sp);
char *queue = strtok_r(NULL, "", &sp);
char *queue = strtok_r(NULL, "", &sp);
- if (port == NULL || queue == NULL) {
+ if (port
_s
== NULL || queue == NULL) {
ovs_fatal(0, "\"enqueue\" syntax is \"enqueue:PORT:QUEUE\"");
}
ovs_fatal(0, "\"enqueue\" syntax is \"enqueue:PORT:QUEUE\"");
}
- put_enqueue_action(b, str_to_u32(port), str_to_u32(queue));
+ put_enqueue_action(b, str_to_u32(port
_s
), str_to_u32(queue));
} else if (!strcasecmp(act, "drop")) {
/* A drop action in OpenFlow occurs by just not setting
* an action. */
} else if (!strcasecmp(act, "drop")) {
/* A drop action in OpenFlow occurs by just not setting
* an action. */
@@
-397,7
+400,7
@@
parse_ofp_str(char *string, struct ofp_match *match, struct ofpbuf *actions,
*priority = OFP_DEFAULT_PRIORITY;
}
if (idle_timeout) {
*priority = OFP_DEFAULT_PRIORITY;
}
if (idle_timeout) {
- *idle_timeout =
DEFAULT_IDLE_TIMEOU
T;
+ *idle_timeout =
OFP_FLOW_PERMANEN
T;
}
if (hard_timeout) {
*hard_timeout = OFP_FLOW_PERMANENT;
}
if (hard_timeout) {
*hard_timeout = OFP_FLOW_PERMANENT;