home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / trace / tcpdump-2.2.1 / interface.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-02  |  3.4 KB  |  112 lines

  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__
  34. extern char *malloc();
  35. extern char *calloc();
  36. #endif
  37.  
  38. extern int dflag;        /* print filter code */
  39. extern int eflag;        /* print ethernet header */
  40. extern int nflag;        /* leave addresses as numbers */
  41. extern int Nflag;        /* remove domains from printed host names */
  42. extern int qflag;        /* quick (shorter) output */
  43. extern int Sflag;        /* print raw TCP sequence numbers */
  44. extern int tflag;        /* print packet arrival time */
  45. extern int vflag;        /* verbose */
  46. extern int xflag;        /* print packet in hex */
  47.  
  48. extern char *program_name;    /* used to generate self-identifying messages */
  49.  
  50. extern int snaplen;
  51. /* global pointers to beginning and end of current packet (during printing) */
  52. extern unsigned char *packetp;
  53. extern unsigned char *snapend;
  54.  
  55. extern long thiszone;            /* gmt to local correction */
  56.  
  57. extern void ts_print();
  58. extern int clock_sigfigs();
  59.  
  60. extern char *lookup_device();
  61.  
  62. extern void error();
  63. extern void warning();
  64.  
  65. extern char *read_infile();
  66. extern char *copy_argv();
  67.  
  68. extern void usage();
  69. extern void show_code();
  70. extern void init_addrtoname();
  71.  
  72. /* The printer routines. */
  73.  
  74. extern void ether_if_print();
  75. extern void arp_print();
  76. extern void ip_print();
  77. extern void tcp_print();
  78. extern void udp_print();
  79. extern void icmp_print();
  80. extern void default_print();
  81.  
  82. extern void ntp_print();
  83. extern void nfsreq_print();
  84. extern void nfsreply_print();
  85. extern void ns_print();
  86. extern void ddp_print();
  87. extern void rip_print();
  88. extern void tftp_print();
  89. extern void bootp_print();
  90. extern void snmp_print();
  91. extern void sl_if_print();
  92. extern void ppp_if_print();
  93. extern void fddi_if_print();
  94. extern void null_if_print();
  95. extern 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
  112.