pcap_if 구조체
pcap_if 구조체는 network interface를 linked-list 로 저장하기 위한 구조체이다.
이 구조체를 사용하는 대표적인 함수로는 pcap_findalldev()가 있다.
Source Code[libpcap-github]
Path: libpcap/pcap/pcap.h
struct pcap_if { struct pcap_if *next; /* "pcap_open_live()"함수에 사용되는 이름 */ char *name; /* name to hand to "pcap_open_live()" */ /* 인터페이스 설명 혹은 NULL */ char *description; /* textual description of interface, or NULL */ struct pcap_addr *addresses; /* PCAP_IF_ 인터페이스 플래그 */ bpf_u_int32 flags; /* PCAP_IF_ interface flags */ };
부록
pcap_addr 구조체는 네트워크 주소(IP, Netmask 등)을 저장하기 위한 구조체이다.
자세한 내용을 해당 글 참고하자.