Ethereal-dev: [Ethereal-dev] how headers get its structure initialized in each packet file in

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "bunty " <bunty123_4@xxxxxxxxxxxxxx>
Date: 5 May 2005 11:56:24 -0000

  hello,
      I found following is required to set iph header. I want to understand it and require any explanation on it.

static e_ip eip_arr[4];
  static int eip_current=0;
  e_ip *iph;
  const guchar          *src_addr, *dst_addr;

  eip_current++;
  if(eip_current==4){
    eip_current=0;
  }
  iph=&eip_arr[eip_current];


Same case with tcp packet structure
static int tcph_count=0;

  tcph_count++;
  if(tcph_count>=4){
    tcph_count=0;
  }
  tcph=&tcphstruct[tcph_count];

        Whats is this type of format of assigning pointer to header structure?
Thanks in Advance.
regards,
bunty.