pcap_t *pcap_open_live( const char * device, const int snaplen, const int promisc, const int to_ms, char * ebuf);
... promisc: Specifies that the device is to be put into promiscuous mode. A value of 1 (True) turns promiscuous mode on. If this parameter is 0 (False), the device will remain unchanged. In this case, if it has already been set to promiscuous mode (for some other reason), it will remain in this mode.
세 번째 인자인 promisc 에 0을 주면 promiscuous 모드를 켜지 않는다고 나오네요. 하지만 이미 켜져 있는 경우엔 그대로 둘뿐 굳이 끄지는 않는다고 하고요.
아래의 문서에도, promisc에 0을 주어도 다른 이유로 promiscuous 모드가 켜져있을 수 있다는 말이 나오는데, 위의 IBM 문서와 비슷한 맥락이 아닐까 싶습니다.
promisc specifies if the interface is to be put into promiscuous mode. (Note that even if this parameter is false, the interface could well be in promiscuous mode for some other reason.) For now, this doesn't work on the "any" device; if an argument of "any" or NULL is supplied, the promisc flag is ignored.
http://publib.boulder.ibm.com
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/pcap_open_live.htm
세 번째 인자인 promisc 에 0을 주면 promiscuous 모드를 켜지 않는다고 나오네요. 하지만 이미 켜져 있는 경우엔 그대로 둘뿐 굳이 끄지는 않는다고 하고요.
아래의 문서에도, promisc에 0을 주어도 다른 이유로 promiscuous 모드가 켜져있을 수 있다는 말이 나오는데, 위의 IBM 문서와 비슷한 맥락이 아닐까 싶습니다.
http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#gaae6abe06e15c87b803f69773822beca8
정확한 것은 문서를 참고하시고, 운영하시는 시스템에서 테스트로 확인해 보십시오.
댓글 달기