2009. 8. 21. 17:44
pcap_t, pcap_pkthdr 구조체
2009. 8. 21. 17:44 in 공부합시다/소켓프로그래밍
struct pcap {
int fd;
int snapshot;
int linktype;
int tzoff; /* timezone offset */
int offset; /* offset for proper alignment */
struct pcap_sf sf; /* save file 관련 구조체 */
struct pcap_md md; /* 패킷의 상태에 대한 정보 */
/*
* Read buffer.
*/
int bufsize;
u_char *buffer;
u_char *bp;
int cc;
/*
* Place holder for pcap_next().
*/
u_char *pkt;
/*
* Placeholder for filter code if bpf not in kernel.
*/
struct bpf_program fcode;
char errbuf[PCAP_ERRBUF_SIZE];
};
typedef struct pcap pcap_t;
=======================================================================================================
Each packet in the dump file is prepended with this generic header.
This gets around the problem of different headers for different
packet interfaces.
struct pcap_pkthdr {
struct timeval ts; /* time stamp */
bpf_u_int32 caplen; /* length of portion present */
bpf_u_int32 len; /* length this packet (off wire) */
};
=======================================================================================================
int fd;
int snapshot;
int linktype;
int tzoff; /* timezone offset */
int offset; /* offset for proper alignment */
struct pcap_sf sf; /* save file 관련 구조체 */
struct pcap_md md; /* 패킷의 상태에 대한 정보 */
/*
* Read buffer.
*/
int bufsize;
u_char *buffer;
u_char *bp;
int cc;
/*
* Place holder for pcap_next().
*/
u_char *pkt;
/*
* Placeholder for filter code if bpf not in kernel.
*/
struct bpf_program fcode;
char errbuf[PCAP_ERRBUF_SIZE];
};
typedef struct pcap pcap_t;
=======================================================================================================
Each packet in the dump file is prepended with this generic header.
This gets around the problem of different headers for different
packet interfaces.
struct pcap_pkthdr {
struct timeval ts; /* time stamp */
bpf_u_int32 caplen; /* length of portion present */
bpf_u_int32 len; /* length this packet (off wire) */
};
=======================================================================================================
'공부합시다 > 소켓프로그래밍' 카테고리의 다른 글
패킷 캡쳐로 살펴본 이더넷 프레임 (0) | 2009.09.15 |
---|---|
이더넷 프레임의 구조 (0) | 2009.09.15 |
[소켓프로그래밍] WSAAsyncSelect (0) | 2009.07.09 |
[소켓프로그래밍] setsockopt (0) | 2009.07.08 |
[소켓프로그래밍] winsock.h 중복 재정의 에러, error C2011: 'fd_set' : 'struct' type redefinition (0) | 2009.07.03 |