2
Mac Lion에서 네트워크 스니퍼의 기존 소스 코드를 컴파일하려고합니다. 나는 libpcap을 설치했다. 소스에는 헤더 파일 /usr/include/net/if.h가 포함되어 있습니다.이 파일은 아래와 같이 컴파일 오류를 발생시킵니다./usr/include/net/if.h를 사용할 때 컴파일 오류가 발생했습니다.
Floyd:~ Shastry$ gcc -o arplisten arplisten.c -lpcap
In file included from arplisten.c:4:
/usr/include/net/if.h:265: error: field ‘ifru_addr’ has incomplete type
/usr/include/net/if.h:266: error: field ‘ifru_dstaddr’ has incomplete type
/usr/include/net/if.h:267: error: field ‘ifru_broadaddr’ has incomplete type
/usr/include/net/if.h:308: error: field ‘ifra_addr’ has incomplete type
/usr/include/net/if.h:309: error: field ‘ifra_broadaddr’ has incomplete type
/usr/include/net/if.h:310: error: field ‘ifra_mask’ has incomplete type
/usr/include/net/if.h:393: error: field ‘addr’ has incomplete type
/usr/include/net/if.h:394: error: field ‘dstaddr’ has incomplete type
arplisten.c:6:24: error: netinet/if.h: No such file or directory
arplisten.c: In function ‘main’:
arplisten.c:139: warning: incompatible implicit declaration of built-in function ‘strlen’
Floyd:~ Shastry$
저는 많은 도움을 청했습니다. 누군가 이걸로 나를 도울 수 있습니까?
다른 모든 것을 포함하여 if.h를 포함시킨 후 작업 한 것! 엄청 고마워! – Ashwin