Sponge
CS144's user-space TCP library
Functions
udp_tcpdump.cc File Reference
#include "parser.hh"
#include "tcp_header.hh"
#include "tcp_segment.hh"
#include "util.hh"
#include <arpa/inet.h>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <pcap/pcap.h>
#include <sstream>
#include <string>
#include <sys/socket.h>
#include <unistd.h>
#include <vector>
Include dependency graph for udp_tcpdump.cc:

Go to the source code of this file.

Functions

static void check_arg (char *arg0, int argc, int curr, const char *errmsg)
 
static string inet4_addr (const uint8_t *data)
 
static string inet6_addr (const uint8_t *data)
 
int main (int argc, char **argv)
 
static int parse_arguments (int argc, char **argv, char **dev_ptr)
 
static int process_ipv4_ipv6 (int len, const uint8_t *data, string &src_addr, string &dst_addr)
 
static void show_usage (const char *arg0, const char *errmsg)
 

Function Documentation

◆ check_arg()

static void check_arg ( char *  arg0,
int  argc,
int  curr,
const char *  errmsg 
)
static

Definition at line 37 of file udp_tcpdump.cc.

◆ inet4_addr()

static string inet4_addr ( const uint8_t data)
static

Definition at line 64 of file udp_tcpdump.cc.

◆ inet6_addr()

static string inet6_addr ( const uint8_t data)
static

Definition at line 73 of file udp_tcpdump.cc.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 128 of file udp_tcpdump.cc.

◆ parse_arguments()

static int parse_arguments ( int  argc,
char **  argv,
char **  dev_ptr 
)
static

Definition at line 44 of file udp_tcpdump.cc.

◆ process_ipv4_ipv6()

static int process_ipv4_ipv6 ( int  len,
const uint8_t data,
string src_addr,
string dst_addr 
)
static

Definition at line 82 of file udp_tcpdump.cc.

◆ show_usage()

static void show_usage ( const char *  arg0,
const char *  errmsg 
)
static

Definition at line 21 of file udp_tcpdump.cc.