The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pcap_test.c File Reference

Simple pcap testing code. More...

#include <projectcommon.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <cdp.h>
#include <lldp.h>
#include <address_family_numbers.h>
#include <server_dump.h>
#include <pcap_min.h>
#include <frameset.h>
#include <frame.h>
#include <addrframe.h>
#include <cstringframe.h>
#include <netio.h>
#include <intframe.h>
#include <frametypes.h>
#include <tlvhelper.h>
Include dependency graph for pcap_test.c:

Go to the source code of this file.

Macros

#define DIMOF(a)   (sizeof(a)/sizeof(a[0]))
 
#define PCAP   "../pcap/"
 

Functions

FSTATIC void frameset_tests (void)
 
FSTATIC void cast_frameset_tests (void)
 Basic tests of our Class system, and for good measure testing of some Frame and FrameSet objects. More...
 
FSTATIC void address_tests (void)
 Basic tests of a few different kinds of AddrFrame class objects. More...
 
int main (int argc, char **argv)
 Main program for performing tests that don't need a network. More...
 

Detailed Description

Simple pcap testing code.

Reads a few packets from pcap capture files, and then listens for LLDP packets on the network. Also does a few other basic unit tests that don't require a network.

This file is part of the Assimilation Project.

Author
Copyright © 2011, 2012 - Alan Robertson alanr.nosp@m.@uni.nosp@m.x.sh
The Assimilation software is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Assimilation software 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 the Assimilation Project software. If not, see http://www.gnu.org/licenses/

Definition in file pcap_test.c.

Macro Definition Documentation

#define DIMOF (   a)    (sizeof(a)/sizeof(a[0]))

Definition at line 44 of file pcap_test.c.

Referenced by address_tests(), cast_frameset_tests(), and main().

#define PCAP   "../pcap/"

Definition at line 191 of file pcap_test.c.

Referenced by main().

Function Documentation

FSTATIC void cast_frameset_tests ( void  )

Basic tests of our Class system, and for good measure testing of some Frame and FrameSet objects.

Definition at line 53 of file pcap_test.c.

References ADDR_FAMILY_IPV4, addrframe_new(), _CstringFrame::baseclass, CASTTOCLASS, cstringframe_new(), DIMOF, frame_new(), frameset_append_frame(), frameset_construct_packet(), frameset_new(), intframe_new(), proj_class_dump_live_objects(), _AddrFrame::setaddr, _IntFrame::setint, _Frame::setvalue, signframe_new(), tlv_set_guint16(), UNREF, and UNREF2.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void frameset_tests ( void  )
int main ( int  argc,
char **  argv 
)

Main program for performing tests that don't need a network.

Definition at line 195 of file pcap_test.c.

References address_tests(), cast_frameset_tests(), DIMOF, dump_cdp_packet(), dump_lldp_packet(), dump_mem(), is_valid_cdp_packet(), and PCAP.

Here is the call graph for this function: