Permalink
Browse files

Awkward conditional macro definitions

As a consequence of splitting out the protocol parsing from epcap,
header definitions are spread through a few different projects. It was
only a matter of time.
  • Loading branch information...
1 parent 4941f02 commit 5988ba5158e0260570813ab1b0293b6889d0b340 @msantos committed Apr 1, 2011
Showing with 18 additions and 2 deletions.
  1. +18 −2 include/pkt.hrl
View
@@ -19,8 +19,24 @@
-define(DLT_EN10MB, 1). % Ethernet
-define(DLT_LINUX_SLL, 113). % Linux cooked sockets fake hdr
--define(PF_INET, 2).
--define(PF_INET6, 10).
+-ifndef(PF_UNSPEC).
+-define(PF_UNSPEC,0). % Unspecified.
+-endif.
+-ifndef(PF_LOCAL).
+-define(PF_LOCAL, 1). % Local to host (pipes and file-domain).
+-endif.
+-ifndef(PF_UNIX).
+-define(PF_UNIX, ?PF_LOCAL). % POSIX name for PF_LOCAL.
+-endif.
+-ifndef(PF_INET).
+-define(PF_INET, 2). % IP protocol family.
+-endif.
+-ifndef(PF_INET6).
+-define(PF_INET6, 10). % IP version 6.
+-endif.
+-ifndef(PF_PACKET).
+-define(PF_PACKET, 17). % Packet family.
+-endif.
-define(IPPROTO_IP, 0).
-define(IPPROTO_ICMP, 1).

0 comments on commit 5988ba5

Please sign in to comment.