packet.h

来自「一个学习SNMP项目:tmoerlan.」· C头文件 代码 · 共 64 行

H
64
字号
/* $Id: packet.h,v 1.2 2003/09/17 11:26:10 tmoerlan Exp $ */#ifndef _SNAP_PACKET_H_#define _SNAP_PACKET_H_#ifdef __KERNEL__#include <linux/skbuff.h>#include <snap/bytecode.h>#else#include "bytecode.h"#endif/* a heap is just a buffer with some meta-data off the front */typedef struct {  int lenb;			/* for now, length in bytes */  char *h;			/* the heap */} heap_t;/* packet header layout */#include "snap.h"typedef struct snaphdr header_t;/* active packets */typedef struct {  header_t *hdr;  unsigned char rb;  /* code */  instr_t *code_min;  instr_t *pc;  instr_t *handler;  instr_t *code_max;  /* stack */  value_t *stack_min;  value_t *sp; 		  /* points above top value (i.e. alloc, then incr) */  value_t *stack_max;  /* in-packet heap */  void *heap_min;  void *h_alloc_ptr; 	  /* used only during assembly */  void *heap_max;  /* heap allocation pointer at runtime is stack_max, growing down;     value pointed to by stack_max is legal (i.e. decr, then alloc) */  void *h_alloc_heap_max; /* essentially the top of the buffer */  /* used for optimizing marshalling---allows the marshaller to     assume that the packet is already marshalled, starting at the     hdr address. */  unsigned int is_contiguous;  int resized;			/* whether we have resized the buffer				   or not */#ifdef __KERNEL__  struct sk_buff *skb;#else  struct iphdr *iph;		/* points to the IP header of the				   buffer the packet is stored in */#endif /* __KERNEL__ */} packet_t;#ifndef __KERNEL__extern void fprintf_packet(FILE *f,packet_t *p);#endif /* !__KERNEL__ */#endif /* _SNAP_PACKET_H_ */

⌨️ 快捷键说明

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