tcpdump源码了解

00

struct netdissect_options {
  int ndo_bflag;                /* print 4 byte ASes in ASDOT notation */
  int ndo_eflag;                /* print ethernet header 打印出以太网头部*/ 
  int ndo_fflag;                /* don't translate "foreign" IP address */
  int ndo_Kflag;                /* don't check TCP checksums */
  int ndo_nflag;                /* leave addresses as numbers 不将地址转换为名字*/
  int ndo_Nflag;                /* remove domains from printed host names */
  int ndo_qflag;                /* quick (shorter) output */
  int ndo_mflag;                /* use the libsmi to translate OIDs */
  int ndo_Sflag;                /* print raw TCP sequence numbers */
  int ndo_tflag;                /* print packet arrival time 报文到达时间*/
  int ndo_uflag;                /* Print undecoded NFS handles */
  int ndo_vflag;                /* verbosity level 详细信息*/
  int ndo_xflag;                /* print packet in hex 十六进制打印报文*/
  int ndo_Xflag;                /* print packet in hex/ascii 十六进制和ASCII码打印报文*/
  int ndo_Aflag;                /* print packet only in ascii observing TAB,
                                 * LF, CR and SPACE as graphical chars
                                   以ASCII码显示打印报文*/
  int ndo_Hflag;                /* dissect 802.11s draft mesh standard */
  int ndo_packet_number;        /* print a packet number in the beginning of line */
  int ndo_suppress_default_print; /* don't use default_print() for unknown packet types */
  int ndo_tstamp_precision;     /* requested time stamp precision */
  const char *program_name;     /* Name of the program using the library */

  char *ndo_espsecret;
  struct sa_list *ndo_sa_list_head;  /* used by print-esp.c */
  struct sa_list *ndo_sa_default;

  char *ndo_sigsecret;          /* Signature verification secret key */

  int   ndo_packettype; /* as specified by -T */

  int   ndo_snaplen;

  /*global pointers to beginning and end of current packet (during printing) */
  const u_char *ndo_packetp;
  const u_char *ndo_snapend;

  /* pointer to the if_printer function */
  if_printer ndo_if_printer;

  /* pointer to void function to output stuff */
  void (*ndo_default_print)(netdissect_options *,
                            register const u_char *bp, register u_int length);

  /* pointer to function to do regular output */
  int  (*ndo_printf)(netdissect_options *,
                     const char *fmt, ...)
#ifdef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
                     __attribute__ ((format (printf, 2, 3)))
#endif
                     ;
  /* pointer to function to output errors 默认的打印函数*/
  void (*ndo_error)(netdissect_options *,
                    const char *fmt, ...)
#ifdef __ATTRIBUTE___NORETURN_OK_FOR_FUNCTION_POINTERS
                     __attribute__ ((noreturn))
#endif /* __ATTRIBUTE___NORETURN_OK_FOR_FUNCTION_POINTERS */
#ifdef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
                     __attribute__ ((format (printf, 2, 3)))
#endif /* __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS */
                     ;
  /* pointer to function to output warnings */
  void (*ndo_warning)(netdissect_options *,
                      const char *fmt, ...)
#ifdef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
                     __attribute__ ((format (printf, 2, 3)))
#endif
                     ;
};

转载于:https://my.oschina.net/u/2357574/blog/608742

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值