- SHASH_FOR_EACH (node, args) {
- if (!strcmp(node->name, "remote_ip")) {
- struct in_addr in_addr;
- if (lookup_ip(node->data, &in_addr)) {
- VLOG_WARN("%s: bad %s 'remote_ip'", name, type);
- } else {
- config->daddr = in_addr.s_addr;
- }
- } else if (!strcmp(node->name, "local_ip")) {
- struct in_addr in_addr;
- if (lookup_ip(node->data, &in_addr)) {
- VLOG_WARN("%s: bad %s 'local_ip'", name, type);
- } else {
- config->saddr = in_addr.s_addr;
- }
- } else if (!strcmp(node->name, "key") && !strcmp(type, "gre")) {
- if (!strcmp(node->data, "flow")) {
- config->flags |= TNL_F_IN_KEY_MATCH;
- config->flags |= TNL_F_OUT_KEY_ACTION;
- } else {
- config->out_key = config->in_key = htonl(atoi(node->data));
- }
- } else if (!strcmp(node->name, "in_key") && !strcmp(type, "gre")) {
- if (!strcmp(node->data, "flow")) {
- config->flags |= TNL_F_IN_KEY_MATCH;
- } else {
- config->in_key = htonl(atoi(node->data));
- }
- } else if (!strcmp(node->name, "out_key") && !strcmp(type, "gre")) {
- if (!strcmp(node->data, "flow")) {
- config->flags |= TNL_F_OUT_KEY_ACTION;
- } else {
- config->out_key = htonl(atoi(node->data));
- }
- } else if (!strcmp(node->name, "tos")) {
- if (!strcmp(node->data, "inherit")) {
- config->flags |= TNL_F_TOS_INHERIT;
- } else {
- config->tos = atoi(node->data);
- }
- } else if (!strcmp(node->name, "ttl")) {
- if (!strcmp(node->data, "inherit")) {
- config->flags |= TNL_F_TTL_INHERIT;
- } else {
- config->ttl = atoi(node->data);
- }
- } else if (!strcmp(node->name, "csum") && !strcmp(type, "gre")) {
- if (!strcmp(node->data, "true")) {
- config->flags |= TNL_F_CSUM;
- }
- } else if (!strcmp(node->name, "pmtud")) {
- if (!strcmp(node->data, "false")) {
- config->flags &= ~TNL_F_PMTUD;
- }
- } else {
- VLOG_WARN("%s: unknown %s argument '%s'", name, type, node->name);
- }
+ netdev->hwaddr[0] = 0xfe;
+ netdev->hwaddr[1] = 0xff;
+ netdev->hwaddr[2] = 0xff;
+ netdev->hwaddr[3] = n >> 16;
+ netdev->hwaddr[4] = n >> 8;
+ netdev->hwaddr[5] = n;
+ netdev->flags = 0;
+ netdev->change_seq = 1;
+ memset(&netdev->remote_addr, 0, sizeof(netdev->remote_addr));
+ netdev->valid_remote_ip = false;
+ netdev->valid_remote_port = false;
+ netdev->connected = false;
+
+
+ netdev->sockfd = inet_open_passive(SOCK_DGRAM, "", 0, &netdev->local_addr, 0);
+ if (netdev->sockfd < 0) {
+ return netdev->sockfd;