ccndumppcap.c File Reference
Reads in a one or more ccnbs from stdin (e.g.
More...
Go to the source code of this file.
|
Defines |
#define | LLC_LENGTH 4 |
#define | IP_OFFSET LLC_LENGTH |
#define | IP_ADDR_LENGTH 4 |
#define | IP_HDR_LENGTH 20 |
#define | IP_LENGTH_OFFSET IP_OFFSET + 2 |
#define | IP_CHKSUM_OFFSET IP_OFFSET + 10 |
#define | IP_SRC_ADDR_OFFSET IP_CHKSUM_OFFSET + 2 |
#define | IP_DEST_ADDR_OFFSET IP_CHKSUM_OFFSET + IP_ADDR_LENGTH |
#define | UDP_OFFSET IP_OFFSET + IP_HDR_LENGTH |
#define | UDP_HDR_LENGTH 8 |
#define | UDP_LENGTH_OFFSET UDP_OFFSET + 4 |
#define | UDP_CHKSUM_OFFSET UDP_OFFSET + 6 |
#define | DATA_OFFSET UDP_OFFSET + UDP_HDR_LENGTH |
#define | MAX_PACKET 65536 |
#define | DEFAULT_SRC_PORT 55555 |
#define | DEFAULT_DEST_PORT CCN_DEFAULT_UNICAST_PORT_NUMBER |
Functions |
static void | usage (const char *progname) |
static int | dump_udp_packet (pcap_dumper_t *dump_file, unsigned char *ip_src_addr, unsigned char *ip_dest_addr, unsigned short udp_src_port, unsigned short udp_dest_port, const unsigned char *data, size_t data_len, struct timeval *ts) |
static int | process_test (pcap_dumper_t *pcap_out, int content_only, unsigned char *ip_src_addr, unsigned char *ip_dest_addr, unsigned short udp_src_port, unsigned short udp_dest_port, unsigned char *data, size_t n) |
static int | process_fd (pcap_dumper_t *pcap_out, int fd, int content_only, unsigned char *ip_src_addr, unsigned char *ip_dest_addr, unsigned short udp_src_port, unsigned short udp_dest_port) |
int | main (int argc, char **argv) |
Detailed Description
Reads in a one or more ccnbs from stdin (e.g.
as dumped by ccndump), and writes them to a pcap file. Uses the splitting code from ccn_splitccnb.
A CCNx command-line utility.
Copyright (C) 2008, 2009 Palo Alto Research Center, Inc.
This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Definition in file ccndumppcap.c.
Define Documentation
#define DATA_OFFSET UDP_OFFSET + UDP_HDR_LENGTH |
#define DEFAULT_DEST_PORT CCN_DEFAULT_UNICAST_PORT_NUMBER |
#define DEFAULT_SRC_PORT 55555 |
#define IP_CHKSUM_OFFSET IP_OFFSET + 10 |
#define IP_DEST_ADDR_OFFSET IP_CHKSUM_OFFSET + IP_ADDR_LENGTH |
#define IP_LENGTH_OFFSET IP_OFFSET + 2 |
#define IP_OFFSET LLC_LENGTH |
#define IP_SRC_ADDR_OFFSET IP_CHKSUM_OFFSET + 2 |
#define UDP_CHKSUM_OFFSET UDP_OFFSET + 6 |
#define UDP_LENGTH_OFFSET UDP_OFFSET + 4 |
#define UDP_OFFSET IP_OFFSET + IP_HDR_LENGTH |
Function Documentation
static int dump_udp_packet |
( |
pcap_dumper_t * |
dump_file, |
|
|
unsigned char * |
ip_src_addr, |
|
|
unsigned char * |
ip_dest_addr, |
|
|
unsigned short |
udp_src_port, |
|
|
unsigned short |
udp_dest_port, |
|
|
const unsigned char * |
data, |
|
|
size_t |
data_len, |
|
|
struct timeval * |
ts | |
|
) |
| | [static] |
int main |
( |
int |
argc, |
|
|
char ** |
argv | |
|
) |
| | |
static int process_fd |
( |
pcap_dumper_t * |
pcap_out, |
|
|
int |
fd, |
|
|
int |
content_only, |
|
|
unsigned char * |
ip_src_addr, |
|
|
unsigned char * |
ip_dest_addr, |
|
|
unsigned short |
udp_src_port, |
|
|
unsigned short |
udp_dest_port | |
|
) |
| | [static] |
static int process_test |
( |
pcap_dumper_t * |
pcap_out, |
|
|
int |
content_only, |
|
|
unsigned char * |
ip_src_addr, |
|
|
unsigned char * |
ip_dest_addr, |
|
|
unsigned short |
udp_src_port, |
|
|
unsigned short |
udp_dest_port, |
|
|
unsigned char * |
data, |
|
|
size_t |
n | |
|
) |
| | [static] |
static void usage |
( |
const char * |
progname |
) |
[static] |