char *save_ptr = NULL;
struct netdev *netdev = NULL;
struct smap args;
- uint32_t port_no = UINT32_MAX;
+ odp_port_t port_no = ODPP_NONE;
char *option;
int error;
if (!strcmp(key, "type")) {
type = value;
} else if (!strcmp(key, "port_no")) {
- port_no = atoi(value);
+ port_no = u32_to_odp(atoi(value));
} else if (!smap_add_once(&args, key, value)) {
ovs_error(0, "duplicate \"%s\" option", key);
}
char *type = NULL;
const char *name;
struct smap args;
- uint32_t port_no;
+ odp_port_t port_no;
char *option;
int error;
failure = true;
}
} else if (!strcmp(key, "port_no")) {
- if (port_no != atoi(value)) {
+ if (port_no != u32_to_odp(atoi(value))) {
ovs_error(0, "%s: can't change port number from "
"%"PRIu32" to %d",
name, port_no, atoi(value));
}
static bool
-get_port_number(struct dpif *dpif, const char *name, uint32_t *port)
+get_port_number(struct dpif *dpif, const char *name, odp_port_t *port)
{
struct dpif_port dpif_port;
run(parsed_dpif_open(argv[1], false, &dpif), "opening datapath");
for (i = 2; i < argc; i++) {
const char *name = argv[i];
- uint32_t port;
+ odp_port_t port;
int error;
if (!name[strspn(name, "0123456789")]) {
- port = atoi(name);
+ port = u32_to_odp(atoi(name));
} else if (!get_port_number(dpif, name, &port)) {
failure = true;
continue;
free(nodes);
} else {
printf(", could not retrieve configuration (%s)",
- strerror(error));
+ ovs_strerror(error));
}
smap_destroy(&config);
netdev_close(netdev);
} else {
- printf(": open failed (%s)", strerror(error));
+ printf(": open failed (%s)", ovs_strerror(error));
}
putchar(')');
}
error = netdev_open(dpif_port.name, dpif_port.type, &netdev);
if (error) {
- printf(", open failed (%s)", strerror(error));
+ printf(", open failed (%s)", ovs_strerror(error));
continue;
}
error = netdev_get_stats(netdev, &s);
if (error) {
- printf(", could not retrieve stats (%s)", strerror(error));
+ printf(", could not retrieve stats (%s)", ovs_strerror(error));
continue;
}