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) |
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 DATA_OFFSET UDP_OFFSET + UDP_HDR_LENGTH |
Definition at line 51 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define DEFAULT_DEST_PORT CCN_DEFAULT_UNICAST_PORT_NUMBER |
Definition at line 54 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define DEFAULT_SRC_PORT 55555 |
Definition at line 53 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define IP_ADDR_LENGTH 4 |
Definition at line 40 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define IP_CHKSUM_OFFSET IP_OFFSET + 10 |
Definition at line 43 of file ccndumppcap.c.
#define IP_DEST_ADDR_OFFSET IP_CHKSUM_OFFSET + IP_ADDR_LENGTH |
Definition at line 45 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define IP_HDR_LENGTH 20 |
Definition at line 41 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define IP_LENGTH_OFFSET IP_OFFSET + 2 |
Definition at line 42 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define IP_OFFSET LLC_LENGTH |
Definition at line 39 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define IP_SRC_ADDR_OFFSET IP_CHKSUM_OFFSET + 2 |
Definition at line 44 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define LLC_LENGTH 4 |
Definition at line 38 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define MAX_PACKET 65536 |
Definition at line 52 of file ccndumppcap.c.
Referenced by dump_udp_packet(), and main().
#define UDP_CHKSUM_OFFSET UDP_OFFSET + 6 |
Definition at line 50 of file ccndumppcap.c.
#define UDP_HDR_LENGTH 8 |
Definition at line 48 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define UDP_LENGTH_OFFSET UDP_OFFSET + 4 |
Definition at line 49 of file ccndumppcap.c.
Referenced by dump_udp_packet().
#define UDP_OFFSET IP_OFFSET + IP_HDR_LENGTH |
Definition at line 47 of file ccndumppcap.c.
Referenced by dump_udp_packet().
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] |
Definition at line 69 of file ccndumppcap.c.
Referenced by process_test().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 248 of file ccndumppcap.c.
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] |
Definition at line 223 of file ccndumppcap.c.
Referenced by main().
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] |
Definition at line 139 of file ccndumppcap.c.
Referenced by process_fd().
static void usage | ( | const char * | progname | ) | [static] |
Definition at line 57 of file ccndumppcap.c.