~ubuntu-branches/ubuntu/wily/openvswitch/wily

« back to all changes in this revision

Viewing changes to tests/test-stp.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-08-10 11:35:15 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20150810113515-575vj06oq29emxsn
Tags: 2.4.0~git20150810.97bab95-0ubuntu1
* New upstream snapshot from 2.4 branch:
  - d/*: Align any relevant packaging changes with upstream.
* d/*: wrap-and-sort.
* d/openvswitch-{common,vswitch}.install: Correct install location for
  bash completion files.
* d/tests/openflow.py: Explicitly use ovs-testcontroller as provided
  by 2.4.0 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 */
16
16
 
17
17
#include <config.h>
18
 
 
 
18
#undef NDEBUG
19
19
#include "stp.h"
20
20
#include <assert.h>
21
21
#include <ctype.h>
23
23
#include <inttypes.h>
24
24
#include <stdarg.h>
25
25
#include <stdlib.h>
 
26
#include "dp-packet.h"
26
27
#include "ofpbuf.h"
 
28
#include "ovstest.h"
27
29
#include "packets.h"
28
 
#include "vlog.h"
29
 
#include "ovstest.h"
 
30
#include "openvswitch/vlog.h"
30
31
 
31
32
struct bpdu {
32
33
    int port_no;
85
86
}
86
87
 
87
88
static void
88
 
send_bpdu(struct ofpbuf *pkt, int port_no, void *b_)
 
89
send_bpdu(struct dp_packet *pkt, int port_no, void *b_)
89
90
{
90
91
    struct bridge *b = b_;
91
92
    struct lan *lan;
93
94
    assert(port_no < b->n_ports);
94
95
    lan = b->ports[port_no];
95
96
    if (lan) {
96
 
        const void *data = ofpbuf_l3(pkt);
97
 
        size_t size = (char *) ofpbuf_tail(pkt) - (char *) data;
 
97
        const void *data = dp_packet_l3(pkt);
 
98
        size_t size = (char *) dp_packet_tail(pkt) - (char *) data;
98
99
        int i;
99
100
 
100
101
        for (i = 0; i < lan->n_conns; i++) {
109
110
            }
110
111
        }
111
112
    }
112
 
    ofpbuf_delete(pkt);
 
113
    dp_packet_delete(pkt);
113
114
}
114
115
 
115
116
static struct bridge *
316
317
    }
317
318
}
318
319
 
319
 
static void
 
320
OVS_NO_RETURN static void
320
321
err(const char *message, ...)
321
 
    PRINTF_FORMAT(1, 2)
322
 
    NO_RETURN;
 
322
    OVS_PRINTF_FORMAT(1, 2);
323
323
 
324
324
static void
325
325
err(const char *message, ...)
337
337
 
338
338
static void
339
339
warn(const char *message, ...)
340
 
    PRINTF_FORMAT(1, 2);
 
340
    OVS_PRINTF_FORMAT(1, 2);
341
341
 
342
342
static void
343
343
warn(const char *message, ...)
666
666
        free(bridge);
667
667
    }
668
668
    free(tc);
 
669
    fclose(input_file);
669
670
}
670
671
 
671
672
OVSTEST_REGISTER("test-stp", test_stp_main);