~ubuntu-branches/ubuntu/quantal/packeth/quantal

« back to all changes in this revision

Viewing changes to headers.h

  • Committer: Bazaar Package Importer
  • Author(s): David Paleino
  • Date: 2009-10-31 21:27:00 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20091031212700-x2vkemah0nhdn57t
Tags: 1.6.3-1
* New upstream version
* debian/rules rewritten to adapt to new source layout
  - debian/manpages added
  - debian/examples added
  - debian/dirs added
* debian/control:
  - bumped quilt Build-Depends to >= 0.46-7~ (to use --with quilt in
    dh7)
  - Standards-Version bumped to 3.8.3 (no changes needed)
* debian/patches/* refreshed to cleanly apply

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * packETH - ethernet packet generator
 
3
 * By Miha Jemec <jemcek@gmail.com>
 
4
 * Copyright 2003 Miha Jemec, Iskratel
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 *
 
20
 * 
 
21
 */
 
22
 
 
23
#include <gtk/gtk.h>
 
24
 
 
25
/*----------------------------------------------------------------------
 
26
 * Stuff for writing a PCap file
 
27
 */
 
28
#define PCAP_MAGIC                      0xa1b2c3d4
 
29
 
 
30
/* "libpcap" file header (minus magic number). */
 
31
struct pcap_hdr {
 
32
    guint32     magic;          /* magic */
 
33
    guint16     version_major;  /* major version number */
 
34
    guint16     version_minor;  /* minor version number */
 
35
    guint32     thiszone;       /* GMT to local correction */
 
36
    guint32     sigfigs;        /* accuracy of timestamps */
 
37
    guint32     snaplen;        /* max length of captured packets, in octets */
 
38
    guint32     network;        /* data link type */
 
39
};
 
40
 
 
41
/* "libpcap" record header. */
 
42
struct pcaprec_hdr {
 
43
    gint32      ts_sec;         /* timestamp seconds */
 
44
    guint32     ts_usec;        /* timestamp microseconds */
 
45
    guint32     incl_len;       /* number of octets of packet saved in file */
 
46
    guint32     orig_len;       /* actual length of packet */
 
47
};
 
48
 
 
49
/* Link-layer type; */
 
50
static unsigned long pcap_link_type = 1;   /* Default is DLT-EN10MB */
 
51
 
 
52
/* struct for clist */
 
53
struct clist_hdr {
 
54
        gint16 pnrb;    /* packet number */
 
55
        gint32 time;    /* delay since previous packet */
 
56
        gint16 plen;    /* packet length */
 
57
        char src[21];
 
58
        char dst[21];
 
59
        gchar info[21];
 
60
};
 
61
        
 
62
 
 
63
typedef enum {
 
64
        ETH_II,
 
65
        ETH_802_3,
 
66
        ARP,
 
67
        IPv4,
 
68
        UDP,
 
69
        TCP,
 
70
        IGMP,
 
71
        ICMP
 
72
} protocol_type;
 
73
 
 
74