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

pcap.h
Go to the documentation of this file.
1 /* $Id: pcap.h 3553 2011-05-05 06:14:19Z nanang $ */
2 /*
3  * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 #ifndef __PJLIB_UTIL_PCAP_H__
21 #define __PJLIB_UTIL_PCAP_H__
22 
28 #include <pj/types.h>
29 
31 
44 typedef enum pj_pcap_link_type
45 {
48 
50 
51 
55 typedef enum pj_pcap_proto_type
56 {
59 
61 
62 
67 typedef struct pj_pcap_udp_hdr
68 {
74 
75 
81 typedef struct pj_pcap_filter
82 {
87 
92 
99 
106 
113 
120 
122 
123 
125 typedef struct pj_pcap_file pj_pcap_file;
126 
127 
134 PJ_DECL(void) pj_pcap_filter_default(pj_pcap_filter *filter);
135 
145 PJ_DECL(pj_status_t) pj_pcap_open(pj_pool_t *pool,
146  const char *path,
147  pj_pcap_file **p_file);
148 
156 PJ_DECL(pj_status_t) pj_pcap_close(pj_pcap_file *file);
157 
168  const pj_pcap_filter *filter);
169 
184  pj_pcap_udp_hdr *udp_hdr,
185  pj_uint8_t *udp_payload,
186  pj_size_t *udp_payload_size);
187 
188 
193 PJ_END_DECL
194 
195 #endif /* __PJLIB_UTIL_PCAP_H__ */
196 
struct pj_pcap_file pj_pcap_file
Definition: pcap.h:125
pj_pcap_link_type link
Definition: pcap.h:86
pj_status_t pj_pcap_close(pj_pcap_file *file)
pj_pcap_proto_type
Definition: pcap.h:55
pj_uint16_t src_port
Definition: pcap.h:112
pj_uint16_t len
Definition: pcap.h:71
pj_uint32_t ip_dst
Definition: pcap.h:105
pj_uint16_t dst_port
Definition: pcap.h:119
pj_status_t pj_pcap_set_filter(pj_pcap_file *file, const pj_pcap_filter *filter)
pj_uint32_t ip_src
Definition: pcap.h:98
int pj_status_t
pj_uint16_t src_port
Definition: pcap.h:69
unsigned int pj_uint32_t
Definition: pcap.h:81
pj_status_t pj_pcap_open(pj_pool_t *pool, const char *path, pj_pcap_file **p_file)
#define PJ_BEGIN_DECL
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)
void pj_pcap_filter_default(pj_pcap_filter *filter)
pj_pcap_link_type
Definition: pcap.h:44
unsigned char pj_uint8_t
Definition: pcap.h:58
Definition: pcap.h:67
Definition: pcap.h:47
pj_uint16_t csum
Definition: pcap.h:72
pj_pcap_proto_type proto
Definition: pcap.h:91
unsigned short pj_uint16_t
pj_uint16_t dst_port
Definition: pcap.h:70
size_t pj_size_t

 


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.