⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interfac.h

📁 This directory contains source code for tcpdump, a tool for network monitoring and data acquisition
💻 H
📖 第 1 页 / 共 2 页
字号:
extern void l2tp_print          (const u_char *, u_int);
extern void ospf6_print         (const u_char *, u_int);
extern void rip_print           (const u_char *, u_int);
extern void snmp_print          (const u_char *, u_int);
extern void tftp_print          (const u_char *, u_int);
extern void timed_print         (const u_char *, u_int);
extern void wb_print            (const u_char *, u_int);
extern void dvmrp_print         (const u_char *, u_int);
extern void pim_print           (const u_char *, u_int);
extern void pimv1_print         (const u_char *, u_int);
extern void cisco_autorp_print  (const u_char *, u_int);
extern void krb_print           (const u_char *, u_int);
extern void llap_print          (const u_char *, u_int);
extern void atalk_print         (const u_char *, u_int);
extern void ntoh_rsvp_packet    (const u_char *, u_int);
extern void rsvp_print_pkt      (const u_char *, u_int);
extern void ripng_print         (const u_char *, u_int);
extern void ip6_print           (const u_char *, u_int);
extern void bxxp_print          (const u_char *, u_int);
extern void stp_print           (const u_char *, u_int);
extern void radius_print        (const u_char *, u_int);

extern void decnet_print        (const u_char *, u_int, u_int);
extern void lcp_print           (const u_char *, u_int, u_int);
extern void pppoe_print         (const u_char *, u_int, u_int);
extern void arp_print           (const u_char *, u_int, u_int);
extern void vrrp_print          (const u_char *, u_int, u_int ttl);

extern void tcp_print           (const u_char *, u_int, const u_char *, int);
extern void udp_print           (const u_char *, u_int, const u_char *, int);
extern void icmp_print          (const u_char *, u_int, const u_char *);
extern void igrp_print          (const u_char *, u_int, const u_char *);
extern void isakmp_print        (const u_char *, u_int, const u_char *);
extern void xtp_print           (const u_char *, u_int, const u_char *);
extern void axip_print          (const u_char *, u_int, const u_char *);
extern void nfsreply_print      (const u_char *, u_int, const u_char *);
extern void nfsreq_print        (const u_char *, u_int, const u_char *);
extern void nfs2reply_print     (const u_char *, u_int, const u_char *);
extern void nfs2req_print       (const u_char *, u_int, const u_char *);
extern void ospf_print          (const u_char *, u_int, const u_char *);
extern void sunrpcrequest_print (const u_char *, u_int, const u_char *);
extern void cnfp_print          (const u_char *, u_int, const u_char *);
extern void egp_print           (const u_char *, u_int, const u_char *);
extern void print_corba         (const u_char *, u_int, const u_char *);
extern void bootp_print         (const u_char *, u_int, u_short, u_short);
extern void dhcp6_print         (const u_char *, u_int, u_short, u_short);
extern void isoclns_print       (const u_char *, u_int, u_int, const u_char *, const u_char *);
extern int  llc_print           (const u_char *, u_int, u_int, const u_char *, const u_char *);
extern void cdp_print           (const u_char *, u_int, u_int, const u_char *, const u_char *);
extern void rx_print            (const u_char *, u_int, u_int, u_int, u_char *);
extern int  ether_encap_print   (const u_char *, u_int, u_int, u_int);

extern void nbt_tcp_print       (u_char *, u_char *);
extern void nbt_udp137_print    (u_char *, u_char *);
extern void nbt_udp138_print    (u_char *, u_char *);
extern void ipx_netbios_print   (u_char *, u_char *);
extern int  ah_print            (const u_char *);
extern int  hbhopt_print        (const u_char *);
extern int  dstopt_print        (const u_char *);
extern int  frag6_print         (const u_char *, const u_char *);
extern int  rt6_print           (const u_char *, const u_char *);
extern int  esp_print           (const u_char *, const u_char *, int *);
extern int  ipcomp_print        (const u_char *, const u_char *, int *);

extern void iiop_print          (const u_char *, u_int, const u_char *, const u_char *);
extern void sunrpcrm_print      (const u_char *, u_int, const u_char *, const u_char *);
extern void w3mux_print         (const u_char *, u_int, const u_char *, const u_char *);
extern void w3ng_print          (u_int, const u_char *, u_int);
extern void oncrpc_print        (u_int, const u_char *, u_int);
extern void giop_print          (u_int, const u_char *, u_int);

/*
 * Print raw data (ascii and/or hex
 */
void ascii_print             (const u_char *, u_int);
void hex_print               (const u_char *, u_int);
void ascii_print_with_offset (const u_char *, u_int, u_int);
void hex_print_with_offset   (const u_char *, u_int, u_int);
void default_print           (const u_char *, u_int);
void default_print_unaligned (const u_char *, u_int);

/*
 *  Error handling
 */
extern char *err_file;
extern int   err_line;

extern void error (const char *, ...)
#ifdef __GNUC__
  __attribute__((format(printf,1,2)))
#endif
;

extern void warning (const char *, ...)
#ifdef __GNUC__
  __attribute__((format(printf,1,2)))
#endif
;

#define PERROR(x)  do {                   \
                     err_file = __FILE__; \
                     err_line = __LINE__; \
                     error x;             \
                   } while (0)

#define WARNING(x) do {                   \
                     err_file = __FILE__; \
                     err_line = __LINE__; \
                     warning x;           \
                   } while (0)


#ifndef min
#define min(a,b) ((a) > (b) ? (b) : (a))
#endif

#ifndef max
#define max(a,b) ((b) > (a) ? (b) : (a))
#endif

/*
 * The default snapshot length.  This value allows most printers to print
 * useful information while keeping the amount of unwanted data down.
 * In particular, it allows for an ethernet header, tcp/ip header, and
 * 14 bytes of data (assuming no ip options).
 */
/* TCP in IPv6 in ICMP in IPv6 in IP in ETHER == 20+40+8+40+20+16
 */
#define DEFAULT_SNAPLEN 144

#ifndef BIG_ENDIAN
#  define BIG_ENDIAN    4321
#  define LITTLE_ENDIAN 1234
#endif

#ifdef ETHER_HEADER_HAS_EA
#  define ESRC(ep) ((ep)->ether_shost.ether_addr_octet)
#  define EDST(ep) ((ep)->ether_dhost.ether_addr_octet)
#else
#  define ESRC(ep) ((ep)->ether_shost)
#  define EDST(ep) ((ep)->ether_dhost)
#endif

#ifdef ETHER_ARP_HAS_X
#  define SHA(ap) ((ap)->arp_xsha)
#  define THA(ap) ((ap)->arp_xtha)
#  define SPA(ap) ((ap)->arp_xspa)
#  define TPA(ap) ((ap)->arp_xtpa)
#else
#  ifdef ETHER_ARP_HAS_EA
#    define SHA(ap) ((ap)->arp_sha.ether_addr_octet)
#    define THA(ap) ((ap)->arp_tha.ether_addr_octet)
#  else
#    define SHA(ap) ((ap)->arp_sha)
#    define THA(ap) ((ap)->arp_tha)
#  endif
#  define SPA(ap) ((ap)->arp_spa)
#  define TPA(ap) ((ap)->arp_tpa)
#endif

#ifndef NTOHL
#  define NTOHL(x)   (x) = ntohl(x)
#  define NTOHS(x)   (x) = ntohs(x)
#  define HTONL(x)   (x) = htonl(x)
#  define HTONS(x)   (x) = htons(x)
#endif

/*
 * Misc. functions
 */

#ifdef USE_FAST_CKSUM
  #ifndef cdecl
  #define cdecl
  #endif

  /* in Watt-32 libwatt.a (chksum0.*) */
  extern u_short cdecl _w32_in_checksum_fast (const void *ptr, int len);

  #define in_cksum(addr,len,csum) (u_short) (~_w32_in_checksum_fast(addr,len))
#else
  extern u_short in_cksum (register u_short *addr,
                           register int len,
                           u_short  csum);
#endif

extern int tcpdump_init (const char *file); /* config.c */
extern int set_cbreak   (int want_brk);     /* libwatt.a(pc_cbrk.c) */

/*
 * Printing to either stdout or conio depending
 * on build-options (see makefiles)
 */
extern int (*__putchar)(int c);
extern int (*__puts)   (const char *s);
extern int (*__printf) (const char *fmt, ...);

extern void set_conio   (void);
extern void unset_conio (void);

extern void status_write (const char *fmt, ...)
#ifdef __GNUC__
  __attribute__((format(printf,1,2)))
#endif
;

extern int colour_main;
extern int colour_stat;
extern int colour_debug;
extern int use_conio;
extern int break_mode;

#ifdef USE_CONIO  /* select conio or stdout at runtime */
#  define PUTS(s)     (*__puts) (s)
#  define PUTCHAR(c)  (*__putchar) (c)
#  define PRINTF      (*__printf)
#else
#  define PUTS(s)     fputs (s, stdout)
#  define PUTCHAR(c)  putchar (c)
#  define PRINTF      printf
#endif

#endif /* tcpdump_interface_h */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -