xorheader.hh

来自「COPE the first practical network coding 」· HH 代码 · 共 33 行

HH
33
字号
#ifndef CLICK_XORHEADER_HH#define CLICK_XORHEADER_HH#include <clicknet/ip.h>#include <clicknet/tcp.h>CLICK_SIZE_PACKED_STRUCTURE(struct click_xor_header {,  uint16_t _ether_type[2];  uint16_t _ipid[2]; // IP ID  uint32_t _src[2] ; // src IP (along with IP ID, uniquely identifies pkt)  uint8_t _alias[2]; // prev hops  uint16_t _len[2];    uint16_t _cksum;  // bunch of debug fields for the snooper  uint32_t _dst[2];  uint16_t _tcp_sport[2];  uint16_t _tcp_dport[2];  tcp_seq_t _tcp_seq[2];  tcp_seq_t _tcp_ack[2];  void set_checksum() {    unsigned int tlen = ((ntohs(_len[1]) > ntohs(_len[0])) ? ntohs(_len[1]) : ntohs(_len[0])) + sizeof(struct click_xor_header);    _cksum = 0;    _cksum = click_in_cksum((unsigned char *)this, tlen);  }});    #endif

⌨️ 快捷键说明

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