#include "ofp-util.h"
#include "ofpbuf.h"
#include "openflow/openflow.h"
+#include "ovs-thread.h"
#include "packets.h"
#include "socket-util.h"
#include "vconn.h"
static char * WARN_UNUSED_RESULT
str_to_be64(const char *str, ovs_be64 *valuep)
{
- uint64_t value;
+ uint64_t value = 0;
char *error;
error = str_to_u64(str, &value);
table_s = strsep(&arg, ",");
if (table_s && table_s[0]) {
- uint32_t table_id;
+ uint32_t table_id = 0;
char *error;
error = str_to_u32(table_s, &table_id);
size_t orig_size = ofpacts->size;
struct ofpact_tunnel *tunnel;
char *error = NULL;
- uint16_t ethertype;
- uint16_t vid;
- uint8_t pcp;
- uint8_t tos;
+ uint16_t ethertype = 0;
+ uint16_t vid = 0;
+ uint8_t tos = 0;
+ uint8_t pcp = 0;
switch (code) {
case OFPUTIL_ACTION_INVALID:
{ "icmp", ETH_TYPE_IP, IPPROTO_ICMP },
{ "tcp", ETH_TYPE_IP, IPPROTO_TCP },
{ "udp", ETH_TYPE_IP, IPPROTO_UDP },
+ { "sctp", ETH_TYPE_IP, IPPROTO_SCTP },
{ "ipv6", ETH_TYPE_IPV6, 0 },
{ "ip6", ETH_TYPE_IPV6, 0 },
{ "icmp6", ETH_TYPE_IPV6, IPPROTO_ICMPV6 },
{ "tcp6", ETH_TYPE_IPV6, IPPROTO_TCP },
{ "udp6", ETH_TYPE_IPV6, IPPROTO_UDP },
+ { "sctp6", ETH_TYPE_IPV6, IPPROTO_SCTP },
{ "rarp", ETH_TYPE_RARP, 0},
{ "mpls", ETH_TYPE_MPLS, 0 },
{ "mplsm", ETH_TYPE_MPLS_MCAST, 0 },
} else{
fm->new_cookie = htonll(0);
}
+ fm->modify_cookie = false;
fm->table_id = 0xff;
fm->command = command;
fm->idle_timeout = OFP_FLOW_PERMANENT;
value);
}
} else if (fields & F_PRIORITY && !strcmp(name, "priority")) {
- uint16_t priority;
+ uint16_t priority = 0;
error = str_to_u16(value, name, &priority);
fm->priority = priority;
return xstrdup("cannot set cookie");
}
error = str_to_be64(value, &fm->new_cookie);
+ fm->modify_cookie = true;
}
} else if (mf_from_name(name)) {
error = parse_field(mf_from_name(name), value, &fm->match);
parse_flow_monitor_request__(struct ofputil_flow_monitor_request *fmr,
const char *str_, char *string)
{
- static uint32_t id;
-
+ static atomic_uint32_t id = ATOMIC_VAR_INIT(0);
char *save_ptr = NULL;
char *name;
- fmr->id = id++;
+ atomic_add(&id, 1, &fmr->id);
+
fmr->flags = (NXFMF_INITIAL | NXFMF_ADD | NXFMF_DELETE | NXFMF_MODIFY
| NXFMF_OWN | NXFMF_ACTIONS);
fmr->out_port = OFPP_NONE;