|
The Assimilation Monitoring Project
|
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>
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... | |
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.
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.
| #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().
| FSTATIC void address_tests | ( | void | ) |
Basic tests of a few different kinds of AddrFrame class objects.
Definition at line 119 of file pcap_test.c.
References ADDR_FAMILY_802, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, addrframe_ipv4_new(), addrframe_ipv6_new(), addrframe_mac48_new(), addrframe_mac64_new(), addrframe_new(), _AddrFrame::baseclass, CASTTOCLASS, CONST_IPV4_LOOPBACK, CONST_IPV6_LOOPBACK, DIMOF, frameset_append_frame(), frameset_construct_packet(), frameset_new(), FRAMETYPE_IPADDR, FRAMETYPE_MACADDR, _Frame::isvalid, proj_class_dump_live_objects(), _AddrFrame::setaddr, signframe_new(), UNREF, and UNREF2.
Referenced by main().


| 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, cma.frameinfo::f, 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().


| 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.
