adding GNU dc ("desk calculator")
[unix-history] / contrib / tcpdump / tcpdump / interface.h
CommitLineData
15637ed4
RG
1/*
2 * Copyright (c) 1988-1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * @(#) $Header: interface.h,v 1.46 92/06/02 17:57:22 mccanne Exp $ (LBL)
22 */
23
24#ifdef __GNUC__
25#define inline __inline
26#else
27#define inline
28#endif
29
30#include "os.h" /* operating system stuff */
31#include "md.h" /* machine dependent stuff */
32
33#ifndef __STDC__
34extern char *malloc();
35extern char *calloc();
36#endif
37
38extern int dflag; /* print filter code */
39extern int eflag; /* print ethernet header */
40extern int nflag; /* leave addresses as numbers */
41extern int Nflag; /* remove domains from printed host names */
42extern int qflag; /* quick (shorter) output */
43extern int Sflag; /* print raw TCP sequence numbers */
44extern int tflag; /* print packet arrival time */
45extern int vflag; /* verbose */
46extern int xflag; /* print packet in hex */
47
48extern char *program_name; /* used to generate self-identifying messages */
49
50extern int snaplen;
51/* global pointers to beginning and end of current packet (during printing) */
52extern unsigned char *packetp;
53extern unsigned char *snapend;
54
55extern long thiszone; /* gmt to local correction */
56
57extern void ts_print();
58extern int clock_sigfigs();
59
60extern char *lookup_device();
61
62extern void error();
63extern void warning();
64
65extern char *read_infile();
66extern char *copy_argv();
67
68extern void usage();
69extern void show_code();
70extern void init_addrtoname();
71
72/* The printer routines. */
73
74extern void ether_if_print();
75extern void arp_print();
76extern void ip_print();
77extern void tcp_print();
78extern void udp_print();
79extern void icmp_print();
80extern void default_print();
81
82extern void ntp_print();
83extern void nfsreq_print();
84extern void nfsreply_print();
85extern void ns_print();
86extern void ddp_print();
87extern void rip_print();
88extern void tftp_print();
89extern void bootp_print();
90extern void snmp_print();
91extern void sl_if_print();
92extern void ppp_if_print();
93extern void fddi_if_print();
94extern void null_if_print();
95extern void egp_print();
96
97#define min(a,b) ((a)>(b)?(b):(a))
98#define max(a,b) ((b)>(a)?(b):(a))
99
100/*
101 * The default snapshot length. This value allows most printers to print
102 * useful information while keeping the amount of unwanted data down.
103 * In particular, it allows for an ethernet header, tcp/ip header, and
104 * 14 bytes of data (assuming no ip options).
105 */
106#define DEFAULT_SNAPLEN 68
107
108#ifndef BIG_ENDIAN
109#define BIG_ENDIAN 4321
110#define LITTLE_ENDIAN 1234
111#endif