Variable name arp_op conflicts with netinet/if_ether.h

40 views
Skip to first unread message

Charles M.C. Chan

unread,
Mar 27, 2014, 6:21:17 AM3/27/14
to trem...@googlegroups.com
There is a match field in OpenFlow 1.3 specification named OFPXMT_OFB_ARP_OP.
In trema-edge implementation, the variable name arp_op is wildly used to represent this match field. E.g. in the definition of function append_action_set_field_arp_op()
However, in /usr/include/netinet/if_ether.h, arp_op is defined as ea_hdr.ar_op using #define.
A trema-edge controller application therefore cannot include 
/usr/include/netinet/ether.h
As a consequence, functions such as ether_ntoa() cannot be used, which is quite inconvenient when handling MAC addresses.
I suggest that we replace all arp_op in trema-edge with arp_opcode. (Fortunately there are not too many of them in the latest version.)

Charles M.C. Chan

unread,
Mar 27, 2014, 6:45:54 AM3/27/14
to trem...@googlegroups.com
Currently I use
#include <netinet/ether.h>
#ifdef arp_op
#undef arp_op
#endif
to solve the problem temporarily, but I am not sure if this causes other problems

Charles M.C. Chan於 2014年3月27日星期四UTC+8下午6時21分17秒寫道:

Yasuhito Takamiya

unread,
Apr 1, 2014, 9:16:54 PM4/1/14
to trem...@googlegroups.com
Hi,
I agree - please send me a PR on GitHub,
then I would merge it. Thanks in advance!

Yasuhito
Reply all
Reply to author
Forward
0 new messages