freebsd 컴파일 질문입다.

ero의 이미지

리눅스에선 컴파일이잘되는데
프비에선 아래와 같은 에러를 뿜어냅니다.

gcc -Wall -Wformat-security -Wno-format-zero-length  -g -O3 -c arp.c
In file included from arp.c:8:
/usr/include/net/if_arp.h:88: error: field 'arp_pa' has incomplete type
/usr/include/net/if_arp.h:89: error: field 'arp_ha' has incomplete type
arp.c:9:29: error: linux/if_packet.h: No such file or directory
arp.c:20: error: 'ETH_ALEN' undeclared here (not in a function)
arp.c: In function 'sendarp':
arp.c:29: error: storage size of 'sll' isn't known
arp.c:54: error: 'PF_PACKET' undeclared (first use in this function)
arp.c:54: error: (Each undeclared identifier is reported only once
arp.c:54: error: for each function it appears in.)
arp.c:54: error: 'ETH_P_RARP' undeclared (first use in this function)
arp.c:57: error: 'AF_PACKET' undeclared (first use in this function)
arp.c:29: warning: unused variable 'sll'
*** Error code 1

프비에선 linux/if_packet.h 헤더대신 다른 걸 사용하는지요?

wariua의 이미지

man 7 packet의 SYNOPSIS입니다:

#include <sys/socket.h>
#include <netpacket/packet.h>
#include <net/ethernet.h> /* the L2 protocols */
 
packet_socket = socket(AF_PACKET, int socket_type, int protocol);

프비가 없어서 확인은 못 해봤습니다.

$PWD `date`