mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-12 00:03:24 +02:00
packet_data_generator2: clear XID field
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
afb153f175
commit
c8fe765eda
@ -24,6 +24,21 @@
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
clear_xid(struct ofpbuf *buf)
|
||||
{
|
||||
/*
|
||||
* some of libofproto message encoding routines automatically
|
||||
* allocate XID for the message. e.g. ofputil_encode_flow_mod
|
||||
* zero-out the XID so that test_parser can perform a simple
|
||||
* bit-wise comparison.
|
||||
*/
|
||||
|
||||
struct ofp_header *oh = ofpbuf_at_assert(buf, 0, sizeof(*oh));
|
||||
|
||||
oh->xid = htonl(0);
|
||||
}
|
||||
|
||||
void
|
||||
dump_ofpbuf(const char *name, const struct ofpbuf *buf)
|
||||
{
|
||||
@ -172,6 +187,7 @@ main(int argc, char *argv[])
|
||||
snprintf(name, sizeof(name),
|
||||
"../packet_data/%s/libofproto-%s-%s.packet",
|
||||
p->dir_name, p->name, m->name);
|
||||
clear_xid(buf);
|
||||
dump_ofpbuf(name, buf);
|
||||
ofpbuf_delete(buf);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user