]>
git.ipfire.org Git - thirdparty/lldpd.git/blob - tests/common.h
1 /* -*- mode: c; c-file-style: "openbsd" -*- */
3 * Copyright (c) 2015 Vincent Bernat <bernat@luffy.cx>
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 #include "check-compat.h"
22 #include "../src/daemon/lldpd.h"
25 * http://wiki.wireshark.org/Development/LibpcapFileFormat
28 u_int32_t magic_number
; /* magic number */
29 u_int16_t version_major
; /* major version number */
30 u_int16_t version_minor
; /* minor version number */
31 u_int32_t thiszone
; /* GMT to local correction */
32 u_int32_t sigfigs
; /* accuracy of timestamps */
33 u_int32_t snaplen
; /* max length of captured packets, in octets */
34 u_int32_t network
; /* data link type */
37 u_int32_t ts_sec
; /* timestamp seconds */
38 u_int32_t ts_usec
; /* timestamp microseconds */
39 u_int32_t incl_len
; /* number of octets of packet saved in file */
40 u_int32_t orig_len
; /* actual length of packet */
44 TAILQ_ENTRY(packet
) next
;
48 TAILQ_HEAD(pkts_t
, packet
);
50 extern int dump
; /* Dump file descriptor in pcap format */
51 extern char filenameprefix
[]; /* Prefix for filename dumping */
52 extern char *filename
; /* Filename we are dumping to */
53 extern char macaddress
[]; /* MAC address we use to send */
55 extern struct pkts_t pkts
; /* List of sent packets */
56 extern struct lldpd_hardware hardware
;
57 extern struct lldpd_chassis chassis
;
59 int pcap_send(struct lldpd
*, struct lldpd_hardware
*, char *, size_t);