2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

vswitchd: Initial conversion to database-based configuration.

This has seen very little testing, so some features are almost certainly
busted.  Port mirroring is not yet converted, so it will definitely not
work.
This commit is contained in:
Ben Pfaff
2009-12-03 11:28:40 -08:00
parent ba54bf4f65
commit 7634353824
24 changed files with 518 additions and 2543 deletions

View File

@@ -17,8 +17,30 @@
#include <config.h>
#include "packets.h"
#include <netinet/in.h>
#include <stdlib.h>
#include "ofpbuf.h"
bool
dpid_from_string(const char *s, uint64_t *dpidp)
{
*dpidp = (strlen(s) == 12 && strspn(s, "0123456789abcdefABCDEF") == 12
? strtoll(s, NULL, 16)
: 0);
return *dpidp != 0;
}
bool
eth_addr_from_string(const char *s, uint8_t ea[ETH_ADDR_LEN])
{
if (sscanf(s, ETH_ADDR_SCAN_FMT, ETH_ADDR_SCAN_ARGS(ea))
== ETH_ADDR_SCAN_COUNT) {
return true;
} else {
memset(ea, 0, ETH_ADDR_LEN);
return false;
}
}
/* Fills 'b' with an 802.2 SNAP packet with Ethernet source address 'eth_src',
* the Nicira OUI as SNAP organization and 'snap_type' as SNAP type. The text
* string in 'tag' is enclosed as the packet payload.