BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB-UTIL Reference

pcap.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJLIB_UTIL_PCAP_H__
20#define __PJLIB_UTIL_PCAP_H__
21
27#include <pj/types.h>
28
30
44{
47
49
50
55{
58
60
61
66typedef struct pj_pcap_udp_hdr
67{
73
74
80typedef struct pj_pcap_filter
81{
86
91
98
105
112
119
121
122
125
126
134
145 const char *path,
146 pj_pcap_file **p_file);
147
156
167 const pj_pcap_filter *filter);
168
183 pj_pcap_udp_hdr *udp_hdr,
184 pj_uint8_t *udp_payload,
185 pj_size_t *udp_payload_size);
186
187
193
194#endif /* __PJLIB_UTIL_PCAP_H__ */
195
unsigned char pj_uint8_t
unsigned short pj_uint16_t
size_t pj_size_t
int pj_status_t
unsigned int pj_uint32_t
pj_status_t pj_pcap_open(pj_pool_t *pool, const char *path, pj_pcap_file **p_file)
struct pj_pcap_file pj_pcap_file
Definition: pcap.h:124
void pj_pcap_filter_default(pj_pcap_filter *filter)
pj_pcap_link_type
Definition: pcap.h:44
pj_status_t pj_pcap_close(pj_pcap_file *file)
pj_status_t pj_pcap_set_filter(pj_pcap_file *file, const pj_pcap_filter *filter)
pj_status_t pj_pcap_read_udp(pj_pcap_file *file, pj_pcap_udp_hdr *udp_hdr, pj_uint8_t *udp_payload, pj_size_t *udp_payload_size)
pj_pcap_proto_type
Definition: pcap.h:55
@ PJ_PCAP_LINK_TYPE_ETH
Definition: pcap.h:46
@ PJ_PCAP_PROTO_TYPE_UDP
Definition: pcap.h:57
#define PJ_BEGIN_DECL
#define PJ_END_DECL
Definition: pcap.h:81
pj_pcap_link_type link
Definition: pcap.h:85
pj_uint16_t dst_port
Definition: pcap.h:118
pj_pcap_proto_type proto
Definition: pcap.h:90
pj_uint32_t ip_src
Definition: pcap.h:97
pj_uint16_t src_port
Definition: pcap.h:111
pj_uint32_t ip_dst
Definition: pcap.h:104
Definition: pcap.h:67
pj_uint16_t src_port
Definition: pcap.h:68
pj_uint16_t len
Definition: pcap.h:70
pj_uint16_t dst_port
Definition: pcap.h:69
pj_uint16_t csum
Definition: pcap.h:71

 


PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library
Copyright (C) 2006-2009 Teluu Inc.