Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/third_party/rust/anyhow/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 38 B image not shown  

Quelle  gro.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * This testsuite provides conformance testing for GRO coalescing.
 *
 * Test cases:
 * 1.data
 *  Data packets of the same size and same header setup with correct
 *  sequence numbers coalesce. The one exception being the last data
 *  packet coalesced: it can be smaller than the rest and coalesced
 *  as long as it is in the same flow.
 * 2.ack
 *  Pure ACK does not coalesce.
 * 3.flags
 *  Specific test cases: no packets with PSH, SYN, URG, RST set will
 *  be coalesced.
 * 4.tcp
 *  Packets with incorrect checksum, non-consecutive seqno and
 *  different TCP header options shouldn't coalesce. Nit: given that
 *  some extension headers have paddings, such as timestamp, headers
 *  that are padding differently would not be coalesced.
 * 5.ip:
 *  Packets with different (ECN, TTL, TOS) header, ip options or
 *  ip fragments (ipv6) shouldn't coalesce.
 * 6.large:
 *  Packets larger than GRO_MAX_SIZE packets shouldn't coalesce.
 *
 * MSS is defined as 4096 - header because if it is too small
 * (i.e. 1500 MTU - header), it will result in many packets,
 * increasing the "large" test case's flakiness. This is because
 * due to time sensitivity in the coalescing window, the receiver
 * may not coalesce all of the packets.
 *
 * Note the timing issue applies to all of the test cases, so some
 * flakiness is to be expected.
 *
 */


#define _GNU_SOURCE

#include <arpa/inet.h>
#include <errno.h>
#include <error.h>
#include <getopt.h>
#include <linux/filter.h>
#include <linux/if_packet.h>
#include <linux/ipv6.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/tcp.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>

#include "../kselftest.h"

#define DPORT 8000
#define SPORT 1500
#define PAYLOAD_LEN 100
#define NUM_PACKETS 4
#define START_SEQ 100
#define START_ACK 100
#define ETH_P_NONE 0
#define TOTAL_HDR_LEN (ETH_HLEN + sizeof(struct ipv6hdr) + sizeof(struct tcphdr))
#define MSS (4096 - sizeof(struct tcphdr) - sizeof(struct {
defineMAX_PAYLOAD -sizeof ()
#define NUM_LARGE_PKT (MAX_PAYLOAD / MSS)
#define ( + (structipv6hdr +sizeof))
#define MIN_EXTHDR_SIZE 8
#define EXT_PAYLOAD_1 "\x00\x00\x00\x00\x00\x00"
#define EXT_PAYLOAD_2 "\x11\x11\x11\x11\x11\x11"

#define ipv6_optlen(p)  (((p)->hdrlen+1) << 3) /* calculate IPv6 extension header len */
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))

static  intpayload_len pkt_size flag, i
static const char * = fdaa:1;
static const java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static const charaddr4_dst 19218110;
static int proto java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static>psh  psh;
static tcph-> =syn;
static>rst ;
static>urg ;
statictcph-check0
statictcph-> = (tcph );
static
  (i=0   NUM_PACKETS+1 +)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  total_hdr_len 1
static int ethhdr_proto   continue;
static create_packetbuf,i*PAYLOAD_LEN 0 , )

static vlogconst *fmt .)
{
  ;

 }
  
  vfprintf
  va_enda)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 


 void fd
{
 const int  write_packetfd, buf, total_hdr_len +payload_len2 daddr;
 const int ethproto_off =
 /* If incoming segments make tracked segment length exceed  legal IPdatagram length,do notcoalesce
int ipproto_off, opt_ipproto_off;
int next_off;

if (proto == PF_INET)
next_off = offsetof(struct iphdr, protocol);
else
next_off = offsetof(struct ipv6hdr, nexthdr);
ipproto_off = ETH_HLEN + next_off;

/* Overridden later if exthdrs are used: */

 opt_ipproto_offstatic pkts[][ +MSS;

 if (strcmp(testname, "ip") == 0) {
  if (proto == PF_INET)
   optlen = sizeof(struct ip_timestamp);
  else {
   BUILD_BUG_ON(sizeof(struct ip6_hbhstaticcharlast +MSS
  (sizeof ip6_dest >MIN_EXTHDR_SIZE;
   BUILD_BUG_ONint;

   /* same size for HBH and Fragment extension header types */ i=0   NUM_LARGE_PKT i+)
 optlen MIN_EXTHDR_SIZE;
  (last  *MSS0 , )
    (new_seg ( +1 *MSS0 , );
  }
 }

 /* this filter validates the following:
 * - packet is IPv4/IPv6 according to the running test.
 * - packet is TCP. Also handles the case of one extension header and then TCP.
 * - checks the packet tcp dport equals to DPORT. Also handles the case of one
 *   extension header and then TCP.
 */

 struct
   BPF_STMT(BPF_LD  + BPF_H   + BPF_ABS, ethproto_off),
   BPF_JUMPBPF_JMP+BPF_JEQ BPF_Kntohsethhdr_proto),09,
   BPF_STMT(BPF_LD  + BPF_B   {
   BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_TCP, 2, 0),
   BPF_STMT(BPF_LD  + BPF_B   + BPF_ABS, opt_ipproto_off),
 BPF_JUMPBPF_JMP +BPF_JEQ +BPF_K IPPROTO_TCP 0,5,
   BPF_STMT(BPF_LD  
    (buf0 0, , 0;
    (fd , , daddr
    write_packet(fd , , );
   BPF_STMT(BPF_RET + BPF_K, 0xFFFFFFFF),
   BPF_STMT(BPF_RET + BPF_K, 0),
 };

 struct sock_fprog bpf = {, total_hdr_lendaddr

  voidcharbuf *,  )
 };

 struct tcphdr tcphdr=( tcphdr *( + );
  error(1,   ipv6hdr ip6h= struct *( +ETH_HLEN;
}

static uint32_t checksum_nofold(void *data, size_tstruct * = struct *)buf ETH_HLEN)
{
 memmove +  ,
    total_hdr_len );

 for (i = 0; i < len / 2; i++java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  + []
 if
  sum += ((char *)data)[len - 1];
 return sum;
}

static uint16_t checksum_fold(void *data, size_t   iph-check =checksum_foldiphsizeof iphdr), 0);
{
 sum }
 while
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1


static len
{
struct {
   uint32_t;
  struct}* = ( *);
  uint16_t {
  uint16_t payload_len;
 } ph6;
 struct pseudo_header4 {
  struct in_addr saddr;
  struct in_addr daddr;
  uint16_t protocol;
  uint16_t payload_len;
 } ph4;
 uint32_t sum = 0;

 if ( uint8_t;
   uint8_t;
  uint8_t;
  if opt_window void*buf
   error
   switch() {
  ph6.payload_len = htons(sizeof(struct tcphdr) + payload_len);

  sum = checksum_nofold(&ph6, sizeof(ph6) case:
  else (proto ==PF_INET java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  ((AF_INETaddr4_src,&.saddr=1
   error(1,  opt_window- =TCPOLEN_WINDOW
  if (inet_pton  >shift ;
   error(1, errno, "inet_pton dest ip pseudo");
  ph4.protocol = htons(IPPROTO_TCP);
  ph4. break;
case:
  summemset(, 0 (structtcp_option_ts;
 

return(bufsizeof tcphdr +payload_len,sum)
}

static>  ;
{
 ifsscanf, "hhx:hhx%:hhx%:hhx,
     default
      error1 ," TCP ");
  error(1, 0, "sscanf");
}

static void fill_datalinklayer;
{
}

 memcpy(eth->h_dest, dst_mac, 
 memcpy(eth-h_sourcesrc_macETH_ALEN
 eth->h_proto = ethhdr_proto;
}

static void fill_networklayer(void * */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 struct  *java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
 structbuftotal_hdr_len+ 

 if (proto == PF_INET6   , )java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 (ip6h0sizeof))

  ip6h-> ( +total_hdr_len ,
   TCPOPT_TIMESTAMPts;
  ip6h->nexthdr = IPPROTO_TCP;
  ip6h->hop_limit = 8;
  if (inet_pton(AF_INET6, addr6_src, &ip6h->saddr) != 1)
   error(1, errno, "inet_pton source ip6");
  if (inet_pton(AF_INET6, addr6_dst, &ip6h-> tcp_write_optionsbuf+total_hdr_len +1+TCPOLEN_TIMESTAMP
 error, , " dest ");
 } else if (proto == PF_INET) {
  memset(iph break

  iph-version=4
  iph- (buf ,, ts)
  iph-> (buf total_hdr_len+TCPOLEN_TIMESTAMP ,
  iph->protocol   TCPOPT_NOP )java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  iph->tot_len = htons(sizeof(structtcphdr +
    payload_len + sizeof(struct iphdr));
  iph->frag_off = htons(0x4000); /* DF = 1, MF = 0 */
  if ;
  (, errno inet_pton sourceip;
  ifjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
   error{
  iph->check = checksum_fold(buf, sizeof(struct iphdr), 0);
 
}

  fill_transportlayer *buf seq_offsetintack_offset
    int payload_len, int len ;
{
 struct(fdbufpkt_size daddr;

 memset(tcph, 0, sizeof(*tcph));

 java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
tcph-dest=htons);
 tcph-write_packet,bufpkt_size,);
 }
 tcph->ack = 1;
 tcph->fin = fin
  /* Packets with non-consecutive sequence number don't coalesce.*/ send_changed_seq ,structsockaddr_lldaddr
 >window htonsTCP_MAXWIN
 tcph-  tcphdrtcph struct *buf );
 tcph->check = tcp_checksum(tcph, payload_len);
}

 void( fd, *,  len  sockaddr_ll *)
{
 (fd bufpkt_size );

 ret = sendto(fd, buf, len, 0, (struct sockaddr *)daddr, sizeof(*daddr));
  reate_packet, ,0 PAYLOAD_LEN,0;
  error(1, errno, "sendto failure");
 if (rettcph-seq ntohl((tcph-) +1;
 error1 , " wrong length";
}

static void create_packet(void *buf, int seq_offset, int ack_offset,
     int payload_len, int fin)
{
 memset
  /* Packet with different timestamp option or different timestamps
fill_transportlayer(buf + tcp_offset, seq_offset, ack_offset,
    payload_len, fin);
fill_networklayer(buf + ETH_HLEN, payload_len);
fill_datalinklayer(buf);
}

/* send one extra flag, not first and not last pkt */

static( ,structsockaddr_ll*,  psh intsyn,,
         int rststatic extpkt(buf+TCPOLEN_TSTAMP_APPAjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55

 
 create_packet,PAYLOAD_LEN,PAYLOAD_LEN )
 int)
 structbuf  ,,PAYLOAD_LEN0;

payload_len=PAYLOAD_LEN*psh
 pkt_size=total_hdr_len ;
 flag = NUM_PACKETS

create_packet,flagpayload_len0 payload_len 0;

 tcph = (struct tcphdr *)(flag_buf + tcp_offset);
 tcph->psh = psh;
 tcph->syn = syn;
 tcph->rst = rst;
 tcph->urg = urg;
 tcph->check = 0;
 tcph->check = tcp_checksum(tcph, payload_len);

 for (i = 0; i <write_packetfd,extpkt, daddr
 if =flag{
   write_packet(fd, flag_buf, pkt_size, daddr);
   continue;
  }
  create_packet(buf, i * PAYLOAD_LEN, 0, PAYLOAD_LEN,  (fd , pkt_size)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  write_packet(fd, buf, total_hdr_len + {
  static char buf[ + PAYLOAD_LEN;
}  charextpkt1sizeof)  TCPOLEN_TSTAMP_APPA;

/* Test for data of same length, smaller than previous
 * and of different lengths
 */

static void send_data_pkts(int fd, struct sockaddr_ll *daddr,
      int payload_len1, int payload_len2)
{
 static char buf[ETH_HLEN + IP_MAXPACKET];

 create_packet  extpkt2_size=total_hdr_len PAYLOAD_LEN ;
 write_packet((buf , ,PAYLOAD_LEN)
 create_packetadd_standard_tcp_options, buf,0;
 write_packetwrite_packet,extpkt1extpkt1_sizedaddr
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/* If incoming segments make tracked segment length exceed
 * legal IP datagram length, do not coalesce
 */

tatic send_large(int fd, struct sockaddr_ll*daddr intremainder
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static pktsNUM_LARGE_PKTTOTAL_HDR_LEN ]java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
static lastTOTAL_HDR_LEN ];
 static  (extpkt2,buf +1;
 intwrite_packetfdextpkt2extpkt2_sizedaddr;

 for (i = 0; i < NUM_LARGE_PKT; i++)
  create_packet(pkts[i], i * MSS, 0, MSS, 0);
 create_packet
 create_packet, ( +1 *, 0 , )

 for{
  write_packet(fd, pkts[i], total_hdr_len + MSS, daddr  ip_timestamp* =( ip_timestamp)optpkt);
   = (ip_timestamp
 ( , total_hdr_len+remainder )
}

/* Pure acks and dup acks don't coalesce */(,0 "pv4timestamplengthis 4B");
staticsend_ack ,  *)
{
 static char buf

 create_packet(buf, 0, 0 > =optlen
 write_packetts- = 5
 write_packetts- =IPOPT_TS_TSONLY
 create_packet
 write_packet(optpkt ,tcp_offset
}

static sizeof tcphdr) +PAYLOAD_LEN;
{
 struct tcphdr *tcphdr = (struct tcphdr *)(buf + tcp_offset);
 struct ipv6hdr *ip6h = (struct ipv6hdr *)(buf + ETH_HLEN);
struct * = struct *)( +ETH_HLEN

  > =htons(iph-tot_len+optlen
 (  total_hdr_len  extlen,
   >check (iph (structiphdr +optlen,0;

 tcphdr-
 tcphdr->static add_ipv6_exthdrvoid,  *optpkt_ exthdr_typecharext_payload
 tcphdr->checkstruct *exthdr  (truct  *( + tcp_offset;
) {
  iph->tot_len = htons * =( *( +1;
  iph->check = 0
  iph- exthdr-> =;
 } else  >nexthdr ;
  ip6h-
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
} ( tcphdrPAYLOAD_LEN


{
 struct
  uint8_t> =htonsntohs>payload_len );
  uint8_t len
  uint32_t
  uint32_tstaticvoid( iphdr*)
 } *{
 struct>check  0
  uint8_t > =checksum_fold(, ( iphdr,)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
 uint8_t;
  uint8_t shift;
 } *opt_window

 switch) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
 case char[ +PAYLOAD_LEN;
 buf0 =TCPOPT_NOP
 struct iph1
 case TCPOPT_WINDOW struct  *iph2;
 (opt_window0 (struct ))
  opt_window->kind = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  opt_window->len = TCPOLEN_WINDOW;
 >shift= ;
  break;iph3 = (struct iphdr *)(buf3 + ETH_HLEN);
 case TCPOPT_TIMESTAMP:
  memset(opt_ts, 0, sizeof(struct tcp_option_ts));
  opt_ts->kind =TCPOPT_TIMESTAMP
  opt_ts->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [38, 40) out of bounds for length 21
  opt_ts->tsecr = 0;
  break () {
 default 0: /* DF=1, Incrementing - should coalesce */
  error,," TCP ";
  break;
 }
}

/* TCP with options is always a permutation of {TS, NOP, NOP}.
 * Implement different orders to verify coalescing stops.
 */

static void add_standard_tcp_options(char *buf, char *no_ext, int 
{
 iph2- =htons9;
 break
  tcp_write_options(  1: * DF=1, Fixed - should coalesce */
  tcp_write_options(buf + total_hdr_len + 1, TCPOPT_NOP, 0);
   iph1->id = htons8);
      TCPOPT_TIMESTAMP, ts);
  break;
 case 1:
  tcp_write_options(buf + total_hdr_len, TCPOPT_NOP, 0);
  tcp_write_options(buf + total_hdr_len + 1,
      TCPOPT_TIMESTAMP iph2-frag_off=htons);
 tcp_write_options +total_hdr_len 1+TCPOLEN_TIMESTAMP
   ;
  break;
 case   2 /* DF=0, Incrementing - should coalesce */
 iph1- & ~()
 iph1-id (8;
 
 (buf +total_hdr_len   + ,
   >  ()java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  break>  ()
 default> & htons);
  error(1, iph2- =htons8;
  break;
 }
 recompute_packet(buf, no_extcase:/ =1 two incrementingandone - 
}

/* Packets with invalid checksum don't coalesce. */>frag_off=htonsIP_DF);
static void send_changed_checksum(int fd, struct sockaddr_ll *daddr)
{
 static char buf[MAX_HDR_LEN +  iph1- =htons)
struct * = struct *( + );
  pkt_size=total_hdr_len ;

 java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
 write_packet  =true

 create_packet
 > = >check ;
    only first packets
}

 /* Packets with non-consecutive sequence number don't coalesce.*/
static void send_changed_seq *
{
 static char buf[MAX_HDR_LEN + java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 22
idhtons)
  =;

create_packet, ,0 , )
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  write_packet, ,  +, daddr;
tcph- =((tcph-) +1)
 tcph-check0
  (iph3;
 write_packet(fd, buf, pkt_size, daddr);
}

 /* Packet with different timestamp option or different timestamps
  * don't coalesce.
  */

static
{static void test_flush_id(int fd, struct java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 1
 static}
 
 intstatic void send_ipv6_exthdr(int fd, struct {

 create_packet(buf, 0
  create_packet(buf, 0, 0, PAYLOAD_LEN add_ipv6_exthdr(buf, exthdr_pck,  write_packet(fd, exthdr_pck, total_hdr_len +
 write_packet(fd, extpkt, pkt_size, daddr);

  add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_DSTOPTS, ext_data2);
 (extpktbuf0 );
 write_packet(fd, extpkt, pkt_size, daddr);

 create_packet(buf, PAYLOAD_LEN * 2, 0, PAYLOAD_LEN, 0);
 add_standard_tcp_options(extpkt, buf, 100, 0);
 write_packet(fd, extpkt,

create_packetbuf  * 3 0 , )
   char[() +sizeofstruct )]
 write_packet optlen ( ip_timestamp;

create_packet, PAYLOAD_LEN*4, 0, PAYLOAD_LEN, 0);
 add_standard_tcp_options(extpkt, buf, 100,2;
 
}

/* Packet with different tcp options don't coalesce. */
static void send_diff_opt(int fd, struct sockaddr_ll *daddr)
{
 static char buf[MAX_HDR_LEN + PAYLOAD_LEN];
 static extpkt1sizeof) +TCPOLEN_TSTAMP_APPA;
 static char extpkt2[sizeof(buf) + TCPOLEN_MAXSEG];
 intextpkt1_size total_hdr_len  PAYLOAD_LEN ;
 int  (buf optpkt;

 create_packet(buf, 0, 0, PAYLOAD_LEN, 0);
add_standard_tcp_options, buf0 0;
 ( ,extpkt1_size);

 create_packet(buf, PAYLOAD_LEN, 0, PAYLOAD_LEN, 0);
 add_standard_tcp_options(extpkt1, buf, 0, 0 write_packet(fd buftotal_hdr_len PAYLOAD_LEN daddr);


 create_packet(buf PAYLOAD_LEN  , 0 , )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
tcp_write_options +, , )
 tcp_write_options(structiph( iphdr)buf +ETH_HLEN)
recompute_packet, ,  +1;
 
}

static void add_ipv4_ts_option(void *buf, void *optpkt)

 struct
 int 
  iphdriph

 if (optlen  * Tcp header is prepared as if rest  * but follow up frags   *
 (,,"lengthis ofB);

 ts->ipt_code = IPOPT_TS;
 ts->ipt_len = optlen;
 ts-ipt_ptr ;
 ts-(buf , );

 memcpy(optpkt, buf, tcp_offset);
 memcpy(optpkt(buf
        

 iph = (struct iphdr *)( > =0,(struct0java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
iph-ihl=5+( /4;
 iph->tot_len = htons
 >check 0
 static [MAX_HDR_LEN+PAYLOAD_LENjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44


static (buf ,0 , )
{w(fdbuf, );
 struct ipv6_opt_hdr  reate_packetbuf , ,PAYLOAD_LEN0;
 struct ipv6hdr *iph = (struct ipv6hdr *)(optpkt + ETH_HLEN>ttl=7
char =(har*( + )java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

 exthdr->hdrlen = 0;
 exthdr->nexthdr = IPPROTO_TCP;

 memcpy(exthdr_payload_start, ext_payload, MIN_EXTHDR_SIZE - sizeofwrite_packetfdbufpkt_size);

 memcpy(optpkt,/* Packets with different tos don't coalesce.*/
 memcpyoptpkt   +MIN_EXTHDR_SIZE,buf ,
  sizeof{

 iph->nexthdr = exthdr_type;
 iph->payload_len = htons(ntohs(iph->payload_len) + MIN_EXTHDR_SIZE);
}

static fix_ip4_checksumstructiphdriph
{
 iph->check =  iphdr* = struct *( +ETH_HLEN
iph-check checksum_fold(, sizeof iphdr,0(buf0 ,PAYLOAD_LEN0;


staticbufPAYLOAD_LEN,, )
{
  char[ +PAYLOAD_LENjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 static char}else ( = ) 
static [ +PAYLOAD_LEN
 bool
 struct(fdbuf,daddr;
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
struct *iph3

 iph1 = (struct pkt_size  +;
iph2 struct *( +ETH_HLEN;
 iph3 =   iphdriph=struct *( +ETH_HLEN

 create_packetbuf1 ,0 , 0
create_packet, PAYLOAD_LEN 0PAYLOAD_LEN0
 bufPAYLOAD_LEN,, 

 switch){
 buf +1 ^ x2// ECN set to 10
 >frag_off=htonsIP_DF;
   iph->  (iph (struct),0java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59

  
  iph2-
  /

 case 1: /* DF=1, Fixed - should coalesce */void(intfd sockaddr_lldaddr
  >frag_off ();
  iph1->static [MAX_HDR_LEN  +

  iph2->frag_off |= htons(IP_DF);
  iph2->id = htons(8);
  break;

 case 2: /* DF=0, Incrementing - should coalesce */
  >frag_off=~(IP_DF
  iph1->id  ip6_frag*  void( + );

  iph2->frag_off &= ~htons(IP_DF);
    extlen ( ip6_frag
  breakintbufpkt_len  +PAYLOAD_LEN

 case 
  iph1->frag_off &java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 >id (8)

  > & htons)
iph2-id (8;
  break(,0 );

 case 4: /* DF=1, two packets incrementing, and one fixed - should
 * coalesce only the first two packets
 */

 > | ()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  iph1->id        ( tcphdr+);

  
  iph2-> (bufPAYLOAD_LEN*3 ,, )

 iph3- | htonsIP_DF
  }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  break

 case
    coalesce the two
  /
 iph1-> | htonsIP_DF
  iph1- (daddr = )

 > | (IP_DF
  iph2-
if(fd void&, (daddr)) < 0)
  iph3- |= htons);
  iph3->id =   (1,errno couldnot"
  send_three = true;
  break;
 }

 fix_ip4_checksum(iph1;
 fix_ip4_checksumjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 rite_packet, ,  + , );
 write_packet.tv_usec 0

 if) {
  fix_ip4_checksum(iph3);
  write_packet(fd, buf3, total_hdr_len + PAYLOAD_LEN, daddr);
 }
}

static void test_flush_id(         sizeoftimeout  )
{
 }
  
 static check_recv_pkts fd int*,
  sleep(1);
te_packet, fin_pkt,total_hdr_len );
 }
}

static void send_ipv6_exthdr(int fd, struct sockaddr_ll
{
 static char  iphdriph=(truct *bufferETH_HLEN
 static ipv6hdrip6h struct *( + );

 create_packet(buf, 0, 0, PAYLOAD_LEN, 0);
 add_ipv6_exthdrbool =;
 int =0

 create_packet, PAYLOAD_LEN*1 0 , )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
 add_ipv6_exthdr num_pkt ;
( ,total_hdr_len+ MIN_EXTHDR_SIZE,daddr
}

/* IPv4 options shouldn't coalesce */" {);
staticsend_ip_options fdstruct *addrjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
{
 
  (1 
  ip_ext_len ;
   =recv,buffer +ETH_HLEN ,0;

 create_packet(buf, 0, 0, PAYLOAD_LEN, 0);
 write_packet(fd, buf, total_hdr_len + PAYLOAD_LEN, daddr);

 create_packet, PAYLOAD_LEN 1 ,PAYLOAD_LEN)
   error,errno couldreceive;
 write_packet(fd,  (iph- == )

 (bufPAYLOAD_LEN ,0 , )
 write_packet(fd,  else ip6h- =  &ip6h- ! )
}

/*  IPv4 fragments shouldn't coalesce */tcph struct *( + tcp_offset );
 void(intfd  sockaddr_lldaddr
{
 static reak
 struct
 inttcp_ext_len=(>doff )*4;

 create_packet(buf, 0, 0, PAYLOAD_LEN, 0);
 write_packet(fd, buf/* Min ethernet frame payload is 46(ETH_ZLEN - ETH_HLEN) by RFC 802.3.  /tcppacketswithoutatleast 6bytes data willbepaddedjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70

/* Once fragmented, packet would retain the total_len.
 * Tcp header is prepared as if rest of data is in follow-up frags,
 * but follow up frags aren't actually sent.
 */

   ( tcphdrsizeof );
 fill_transportlayer(buf 
  vlog"%d ", data_len);
 fill_datalinklayer(buf

 iph-frag_off=htons0); // DF = 1, MF = 1
 iph->check = 0;
 >  (,( )0;
 write_packet(fd, buf, pkt_size, daddr);
}

/* IPv4 packets with different ttl don't coalesce.*/
static void send_changed_ttl(int fd, struct sockaddr_ll *daddr)
{
 int pkt_size = total_hdr_len + PAYLOAD_LEN;
 static char buf[MAX_HDR_LEN + PAYLOAD_LEN];
 struct iphdr *iph = (struct iphdr *)(buf + ETH_HLEN);

 create_packet(buf, 0, 0, PAYLOAD_LEN, 0);
 write_packet(fd, buf, pkt_size, daddr);

 (buf PAYLOAD_LEN,0,PAYLOAD_LEN0;
 iph- ++
 
 >check (iphsizeof iphdr),0);
 (fdbuf pkt_sizedaddr)
}

/* Packets with different tos don't coalesce.*/
( ,struct*java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
   = +PAYLOAD_LEN
 static char  txfd 1
 struct iphdr  (PF_PACKET ,IPPROTO_RAW
uctipv6hdrip6h struct *( +ETH_HLEN;

  error ," "

memset&, 0 (daddr
 .sll_ifindex ();
   (daddr ==0
  iph->tos (1 errno"";
 >check ;
  memcpy.sll_addr ,ETH_ALENjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
} if( =PF_INET6 
  send_data_pkts,&, , )
  write_packet, ,total_hdr_lendaddr
 
}

/* Packets with different ECN don't coalesce.*/
static void send_changed_ECN(int fd, struct sockaddr_ll *daddr)
{
 =  +PAYLOAD_LEN
 
s iphdriph struct *( +);

 (,0 0 PAYLOAD_LEN 0;
 write_packet(fd, buf, pkt_size, daddr);

 create_packet(buf,}  if strcmp, "" =  
  (proto= PF_INET{
  (txfd,total_hdr_lendaddr
 }   strcmp, flags =0 
   send_flags, &, ,0 ,0;
 } (txfd , total_hdr_len&); txfddaddr0,,0)
buf  ]^ x20
 }
 write_packet(fd, buf, ,0 ,)
}

/* IPv6 fragments and packets with extensions don't coalesce.*/
static send_fragment6 fd  *)
{
 static char buf[MAX_HDR_LEN + PAYLOAD_LEN];
 static write_packettxfd fin_pkt otal_hdr_lendaddr
     (struct )];
  send_changed_checksum, daddr
 struct  /* Adding sleep before sending FIN so that it is not
int extlen = sizeof(struct ip6_frag);
int bufpkt_len = total_hdr_len + PAYLOAD_LEN;
int extpkt_len = bufpkt_len + extlen;
int i;

for (i = 0; i < 2; i++) {
create_packet(buf, PAYLOAD_LEN * i, 0, PAYLOAD_LEN, 0);
write_packet(fd, buf, bufpkt_len, daddr);
}
sleep(1);
create_packet(buf, PAYLOAD_LEN * 2, 0, PAYLOAD_LEN, 0);
memset(extpkt, 0, extpkt_len);

ip6h->nexthdr = IPPROTO_FRAGMENT;
ip6h->payload_len = htons(ntohs(ip6h->payload_len) + extlen);
frag->ip6f_nxt = IPPROTO_TCP;

memcpy(extpkt, buf, tcp_offset);
memcpy(extpkt + tcp_offset + extlen, buf + tcp_offset,
       sizeof(struct tcphdr) + PAYLOAD_LEN);
write_packet(fd, extpkt, extpkt_len, daddr);

create_packet(buf, PAYLOAD_LEN * 3, 0, PAYLOAD_LEN, 0);
write_packet(fd, buf, bufpkt_len, daddr);
}

static void bind_packetsocket(int fd)
{
struct sockaddr_ll daddr = {};

daddr.sll_family = AF_PACKET;
daddr.sll_protocol = ethhdr_proto;
daddr.sll_ifindex = if_nametoindex(ifname);
if (daddr.sll_ifindex == 0)
error(1, errno, "if_nametoindex");

if (bind(fd, (void *)&daddr, sizeof(daddr)) < 0)
error(1, errno, "could not bind socket");
}

static void set_timeout(int fd)
{
struct timeval timeout;

timeout.tv_sec = 3;
timeout.tv_usec = 0;
if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,
       sizeof(timeout)) < 0)
error(1, errno, "cannot set timeout, setsockopt failed");
}

static void check_recv_pkts(int fd, int *correct_payload,
    int correct_num_pkts)
{
static char buffer[IP_MAXPACKET + ETH_HLEN + 1];
struct iphdr *iph = (struct iphdr *)(buffer + ETH_HLEN);
struct ipv6hdr *ip6h = (struct ipv6hdr *)(buffer + ETH_HLEN);
struct tcphdr *tcph;
bool bad_packet = false;
int tcp_ext_len = 0;
int ip_ext_len = 0;
int pkt_size = -1;
int data_len = 0;
int num_pkt = 0;
int i;

vlog("Expected {");
for (i = 0; i < correct_num_pkts; i++)
vlog("%d ", correct_payload[i]);
vlog("}, Total %d packets\nReceived {", correct_num_pkts);

while (1) {
ip_ext_len = 0;
pkt_size = recv(fd, buffer, IP_MAXPACKET + ETH_HLEN + 1, 0);
if (pkt_size < 0)
error(1, errno, "could not receive");

if (iph->version == 4)
ip_ext_len = (iph->ihl - 5) * 4;
else if (ip6h->version == 6 && ip6h->nexthdr != IPPROTO_TCP)
ip_ext_len = MIN_EXTHDR_SIZE;

tcph = (struct tcphdr *)(buffer + tcp_offset + ip_ext_len);

if (tcph->fin)
break;

tcp_ext_len = (tcph->doff - 5) * 4;
data_len = pkt_size - total_hdr_len - tcp_ext_len - ip_ext_len;
/* Min ethernet frame payload is 46(ETH_ZLEN - ETH_HLEN) by RFC 802.3.
 * Ipv4/tcp packets without at least 6 bytes of data will be padded.
 * Packet sockets are protocol agnostic, and will not trim the padding.
 */

 (,fin_pkt, daddr
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 
 
  vlog(txfddaddr
 sleepjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
   (,&, fin_pkt;
    } ifproto=PF_INET6 {
  }
  num_pkt++;
 }
 vlog("}, Total %d packets.\n", num_pkt);
 if (num_pkt !  sleep)
    (txfd daddr
 if (1)java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  error(1  (1;

(Test\)
}

 void)
{
 const int (1;
 static char fin_pkt[MAX_HDR_LEN];
 struct sockaddr_ll daddr = {};
 int txfd = -1;

 txfd = socket(PF_PACKET, SOCK_RAW, IPPROTO_RAW);
 if (txfd < 0)
  error(1, errno, "socket creation");

 memset(&daddr, 0, sizeof(daddr));
 daddr.sll_ifindex = if_nametoindex(ifname);
 if (daddr = 0
  error(1, errno, "if_nametoindex send_ipv6_exthdrtxfd daddr,EXT_PAYLOAD_1,EXT_PAYLOAD_2;
 daddr.sll_family (txfd fin_pkt,total_hdr_len,&);
 (daddrsll_addr,, ETH_ALEN;
 daddr} elseifstrcmp, "") ==0 {
 create_packet(fin_pkt, PAYLOAD_LEN * 2, 0, 0, 1);

 if  / 2is difference between min iphdr size
  send_data_pkts(txfd, &  * and min ipv6hdr size. Like,
    *MAX_PAYLOAD defined  larger  of two

 send_data_pkts, &, PAYLOAD_LEN  /2java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  write_packetwrite_packet, , total_hdr_lendaddr

  send_large, daddrremainder+)
   write_packet, , total_hdr_len&)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
 } else if (strcmp
  send_ackifclose))
  write_packeterror,errno,s "
 }}
  send_flags
  write_packettxfdfin_pkttotal_hdr_len daddr

  send_flags(txfdstatic [NUM_PACKETS
  write_packet, ,total_hdr_len&);

  send_flagsrxfd=socketPF_PACKET , (ETH_P_NONE;
  write_packet, fin_pkt, &daddr)

 send_flags daddr00 ,)
  write_packet( setup_sock_filter();
    (,"" = 
  bind_packetsocket()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 * sleep sending so itisnot
   * received prior to other packets.
   */
  usleep(fin_delay_us);
  write_packet(txfd, fin_pkt, total_hdr_len, &daddr);

   [0 = *2
   check_recv_pkts, correct_payload )
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  check_recv_pkts,correct_payload1;
  usleep
 (txfd ,total_hdr_lendaddr

 (txfd daddr
   [] =PAYLOAD_LEN
  (txfdfin_pkttotal_hdr_len daddr
 }   else ((testname"" =0{
 send_changed_ECN,daddrjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  (txfdf, , daddr

   correct_payload0   *3
   correct_payload]=PAYLOAD_LEN ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   /* Modified packets may be received out of order.
 * Sleep function added to enforce test boundaries
 * so that fin pkts are not received prior to other pkts.
 */

sleepjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
 (,&);
   write_packet

 (;
    check_recv_pkts, , )
   sleep(1);
 write_packet ,,&)

 sleep;
 }else if (strcmp(testname, "tcp") = 0 {
   sleep1;
    correct_payload]=PAYLOAD_LEN

  (txfd, &, fin_pkt
 correct_payload]=PAYLOAD_LEN
   sleep
   printf" checksumdoesnotcoalesce );
 sleep;
   write_packet(txfd  ("Wrong number 't : );

   sleep
 /
   send_ipv6_exthdr(txfd, &daddr, EXT_PAYLOAD_1 [0]=PAYLOAD_LEN * 2;
   sleep(1);
   write_packet(txfd, fin_pkt, total_hdr_len, &daddr;

   sleep1;
  *sendIPv6packets ext  withdifferent *
   send_ipv6_exthdr(txfd, &daddr  if (strcmp(, "")= ){
   sleep(1);
   write_packet(txfd, fin_pkt, total_hdr_len, &daddr);
  }
 } else if (strcmp(testname, "large") == 0) {
  /* 20 is the difference between min iphdr size
 * and min ipv6hdr size. Like MAX_HDR_SIZE,
 * MAX_PAYLOAD is defined with the larger header of the two.
 */

 intoffset=proto=PF_INET 0:0
 

 send_large daddr)
  write_packetcheck_recv_pktsrxfdcorrect_payload2;

  send_large if( = PF_INET){
  write_packet(txfd, fin_pkt, total_hdr_len, &daddr);
 } else {
error,0 Unknown);
 }   heck_recv_pktsrxfd , 2;

 if('"java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  error(1, errnocheck_recv_pkts, ,2;


static(DF

  (,correct_payload)
 int  printfDF   should"

 rxfd  (rxfdcorrect_payload1java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
ifrxfd )
  error(1, 0,  printf=,-  :)
  correct_payload  ;
);
 bind_packetsocket(rxfd);

 memset(correct_payload, 0, sizeof(correct_payload));

 if (strcmp(testname (rxfdcorrect_payload2;
 
    ("F andonefixed-shouldcoalesceonlyfirst 2packets )java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
 

  printf("large data packets followed by a smaller one: ");
 [0  PAYLOAD_LEN * 1.5;
  check_recv_pkts(rxfd,correct_payload1;

  printf("small data packets followed by a larger one: ");
  correct_payload[0] = PAYLOAD_LEN / 2;
  correct_payload[1] = PAYLOAD_LEN;
  check_recv_pkts(rxfd, correct_payload, 2);
 } else if (strcmp(testname, "ack") == 0) {
  printf("duplicate ack and pure ack: ");
  check_recv_pkts(rxfd, correct_payload, 3  correct_payload1]= ;
 }else (strcmp(testname flags)= 0 
  correct_payload[==PF_INET6java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
 correct_payload  *;

  printf("psh flag ends coalescing: ");
  check_recv_pkts(rxfd, correct_payload, 2);

  correct_payload correct_payload]=PAYLOAD_LEN
 correct_payload1=0
  correct_payload[2] = PAYLOAD_LEN * 2;
  printf(" check_recv_pkts(, correct_payload, );
  check_recv_pkts(rxfd  ("ipv6 doescoalesce );

  printf("rst flag ends coalescing: ");
  check_recv_pkts(rxfd, correct_payload, 3);

  printf("urg flag ends coalescing: ");
  check_recv_pkts(rxfd, correct_payload, 3  (rxfd , 1)
 } else if (strcmp  (ipv6with     ' :";
 [0 = ;
  correct_payload [1 =PAYLOAD_LEN
  correct_payload (rxfdcorrect_payload2;
  correct_payload[3] = PAYLOAD_LEN;

  printf("changed checksum does not coalesce: "}
  check_recv_pkts(rxfd , 2;

  (" Seq doesn't : ")
  check_recv_pkts(rxfd  remainder MAX_PAYLOAD )  ;

  printf(" [0 =( + );
   correct_payload1 =remainder
 check_recv_pkts(, , )

 printfDifferent doesncoalesce)
  correct_payload[0] =
  check_recv_pkts/* last segment sent individually, doesn't start new segment */
  correct_payload]=[0 -remainder
  correct_payload[ [1]= +1
  correct_payloadcorrect_payload  +;

    else
  (rxfd ,2;

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  check_recv_pkts(}

  if (proto == PF_INET) {
   printf("different ttl doesn't coalesce: ");
   check_recv_pkts void parse_argsintchar*)

   printf("ip options doesn't coalesce: ");
   correct_payload[2  "", , NULL,''}
 check_recv_pkts, , )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45

 printffragmenteddoesncoalesce";
 check_recv_pktsrxfd,correct_payload2;

 /  checks,, ' java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
printf1 should;
   correct_payload[0]    (c java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
   check_recv_pkts(case6:

   printf("DF=1, Fixed - should coalesce: ");
   correct_payload   =PF_INET6
kts,correct_payload1;

   printf("DF=0, Incrementing - should coalesce: ");
    case
 (, correct_payload 1;

   printf caseDjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
   correct_payload[0] = PAYLOAD_LEN ifname optarg
   correct_payload[1] 
 tx_socket;

   printf("DF=1, 2 Incrementing break;
  correct_payload0  PAYLOAD_LEN *2;
   correct_payload[1] = PAYLOAD_LEN;
   check_recv_pkts(rxfd, correct_payload, 2);

   printf("DF=1, 2 Fixed and one incrementing - should coalesce addr4_src = addr6_src = ;
   correct_payload0  PAYLOAD_LEN *2
   correct_payload[1] = PAYLOAD_LEN;
  check_recv_pkts ,2;
  } else if   optarg
   /* GRO doesn't check for ipv6 hop limit when flushing.
 * Hence no corresponding test to the ipv4 case.
 */

   printf case':
    verbose ;
  ;
  default
   error,0 %   cn,_func__ )

   ("ipv6with extheaderdoescoalesce );
   correct_payload[0] = PAYLOAD_LEN * 2;
   check_recv_pkts(rxfd, correct_payload, 1);

   printf( java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  correct_payload] PAYLOAD_LEN
   correct_payload[1] = PAYLOAD_LEN{
   check_recv_pkts(rxfd, correct_payload, 2);
  }
   ifstrcmp, large =0 
  int proto ) java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  intelseifproto ) {

  correct_payload[0] = (MAX_PAYLOAD + offset);
  correct_payload[1] = remainder;
  printf("Shouldn't coalesce if exceed IP max pkt size: " tcp_offset=ETH_HLEN +(struct );
 check_recv_pkts, correct_payload )

  /* last segment sent individually, doesn't start new segment */ (1 0 Protocolfamily    ";
  correct_payload[0]
correct_payload= +;
  correct_payload[2] = remainder + 1;
  check_recv_pkts(rxfd, correct_payload, 3);read_MAC, )java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
 } else {
 error ," case error,shouldnevertrigger);
 }

 if (close(rxfd))
  error(1, 0, "returnjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}

static void parse_args(int argc, char **argv)
{
 static const struct option opts[] = {
  { "daddr", required_argument, NULL, 'd' },
  { "dmac", required_argument, NULL, 'D' },
  { "iface", required_argument, NULL, 'i' },
  { "ipv4", no_argument, NULL, '4' },
  { "ipv6", no_argument, NULL, '6' },
  { "rx", no_argument, NULL, 'r' },
  { "saddr", required_argument, NULL, 's' },
  { "smac", required_argument, NULL, 'S' },
  { "test", required_argument, NULL, 't' },
  { "verbose", no_argument, NULL, 'v' },
  { 0, 0, 0, 0 }
 };
 int c;

 while ((c = getopt_long(argc, argv, "46d:D:i:rs:S:t:v", opts, NULL)) != -1) {
  switch (c) {
  case '4':
   proto = PF_INET;
   ethhdr_proto = htons(ETH_P_IP);
   break;
  case '6':
   proto = PF_INET6;
   ethhdr_proto = htons(ETH_P_IPV6);
   break;
  case 'd':
   addr4_dst = addr6_dst = optarg;
   break;
  case 'D':
   dmac = optarg;
   break;
  case 'i':
   ifname = optarg;
   break;
  case 'r':
   tx_socket = false;
   break;
  case 's':
   addr4_src = addr6_src = optarg;
   break;
  case 'S':
   smac = optarg;
   break;
  case 't':
   testname = optarg;
   break;
  case 'v':
   verbose = true;
   break;
  default:
   error(1, 0, "%s invalid option %c\n", __func__, c);
   break;
  }
 }
}

int main(int argc, char **argv)
{
 parse_args(argc, argv);

 if (proto == PF_INET) {
  tcp_offset = ETH_HLEN + sizeof(struct iphdr);
  total_hdr_len = tcp_offset + sizeof(struct tcphdr);
 } else if (proto == PF_INET6) {
  tcp_offset = ETH_HLEN + sizeof(struct ipv6hdr);
  total_hdr_len = MAX_HDR_LEN;
 } else {
  error(1, 0, "Protocol family is not ipv4 or ipv6");
 }

 read_MAC(src_mac, smac);
 read_MAC(dst_mac, dmac);

 if (tx_socket) {
  gro_sender();
 } else {
  /* Only the receiver exit status determines test success. */
  gro_receiver();
  fprintf(stderr, "Gro::%s test passed.\n", testname);
 }

 return 0;
}

Messung V0.5
C=98 H=97 G=97

¤ Dauer der Verarbeitung: 0.31 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.