Changeset 15 for trunk/src/template.c

Show
Ignore:
Timestamp:
03/16/06 17:45:26 (17 years ago)
Author:
andreu
Message:

?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/template.c

    r2 r15  
    7676  unsigned short tplMsgType = 1; 
    7777 
     78  fprintf (stderr, "NORMAL\n"); 
    7879  buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    7980  buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    8081  getFlowsetId = *((unsigned short*)&buffer2); 
     82  fprintf(stderr,"FlowsetID: %hu \n", getFlowsetId); 
    8183  buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    8284  buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    8385  length = *((unsigned short*)&buffer2); 
     86  fprintf(stderr,"length: %hu \n", length); 
    8487  do { 
    8588    buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
     
    8891         existTplId(cr, v9Ptr->sourceId, 
    8992                    *((unsigned short*)&buffer2)))==NULL) { 
     93      fprintf (stderr, "NEW\n"); 
    9094      cTFSPtr = newRouterTplList(); 
    9195      cTFSPtr->next = cr->tplList; 
     
    9397      cr->tplList = cTFSPtr; 
    9498      cTFSPtr->templateFlowSetId = *((unsigned short*)&buffer2); 
     99      fprintf(stderr,"templateFlowSetId: %hu \n", cTFSPtr->templateFlowSetId); 
    95100      cTFSPtr->sourceId = v9Ptr->sourceId; 
    96101      buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    97102      buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    98103      cTFSPtr->fieldCount = *((unsigned short*)&buffer2); 
     104      fprintf(stderr,"fieldCount: %hu \n", cTFSPtr->fieldCount); 
    99105      cpt_fields = 0; 
    100106      for ( i=0; i<cTFSPtr->fieldCount; i++) { 
     
    130136      } 
    131137    } else { /*update*/ 
     138      fprintf (stderr, "UPDATE\n"); 
    132139      ptpltmp = cTFSPtr; 
    133140      if (ptpltmp->prev == NULL) { 
     
    244251  TplOptionPtr ptplotmp; 
    245252 
     253  fprintf (stderr, "\nOPTION\n"); 
    246254  buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    247255  buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    248256  getFlowsetId = *((unsigned short*)&buffer2); 
     257  fprintf(stderr,"FlowsetID: %hu \n", getFlowsetId); 
    249258  buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    250259  buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    251260  length = *((unsigned short*)&buffer2); 
     261  fprintf(stderr,"length: %hu \n", length); 
    252262  do { 
    253263    buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
     
    256266         existTplOptId(cr, v9Ptr->sourceId,  
    257267                       *((unsigned short*)&buffer2)))==NULL) { 
     268      fprintf (stderr, "NEW\n"); 
    258269      cTOPtr = newRouterTplOptList(); 
    259270      cTOPtr->next = cr->tplOptList; 
     
    261272      cr->tplOptList = cTOPtr; 
    262273      cTOPtr->templateOptionId = *((unsigned short*)&buffer2); 
     274      fprintf(stderr,"templateOptionId: %hu \n", cTOPtr->templateOptionId); 
    263275      cTOPtr->sourceId = v9Ptr->sourceId; 
    264276      buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    265277      buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    266278      cTOPtr->optionScopeLg = *((unsigned short*)&buffer2); 
     279      fprintf(stderr,"optionScopeLg: %hu \n", cTOPtr->optionScopeLg); 
    267280      buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    268281      buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    269282      cTOPtr->optionLg = *((unsigned short*)&buffer2); 
    270       for ( i=0; i<((cTOPtr->optionScopeLg)+(cTOPtr->optionLg)); i++) { 
     283      fprintf(stderr,"optionLg: %hu \n", cTOPtr->optionLg); 
     284      for ( i=0; i<(((cTOPtr->optionScopeLg)+(cTOPtr->optionLg))/4); i++) { 
    271285        FieldPtr tmp = (FieldPtr) malloc(sizeof(struct Field)); 
    272286        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    273287        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    274288        tmp->fieldType = *((unsigned short*)&buffer2); 
     289        fprintf (stderr, " (%hu,", tmp->fieldType); 
    275290        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    276291        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    277292        tmp->fieldLength = *((unsigned short*)&buffer2); 
     293        fprintf (stderr, "%hu)", tmp->fieldLength); 
    278294        tmp->next = cTOPtr->fieldSet; 
    279295        tmp->prev = NULL; 
     
    285301      } 
    286302      while ((*offV9)%4 != 0) { 
     303        fprintf (stderr, "padding\n"); 
    287304        (*offV9)++; cpt++; 
    288305      } /*padding case*/ 
    289306    } else { /*update */ 
     307      fprintf (stderr, "UPDATE\n"); 
    290308      ptplotmp = cTOPtr; 
    291309      if (ptplotmp->prev == NULL) { 
     
    314332      buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    315333      cTOPtr->optionLg = *((unsigned short*)&buffer2); 
    316       for ( i=0; i<((cTOPtr->optionScopeLg)+(cTOPtr->optionLg)); i++) { 
     334      for ( i=0; i<(((cTOPtr->optionScopeLg)+(cTOPtr->optionLg))/4); i++) { 
    317335        FieldPtr tmp = (FieldPtr) malloc(sizeof(struct Field)); 
    318336        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    319337        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    320338        tmp->fieldType = *((unsigned short*)&buffer2); 
     339        fprintf (stderr, " (%hu,", tmp->fieldType); 
    321340        buffer2[1]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    322341        buffer2[0]= *(buf+(*offV9)); (*offV9)++; cpt++; 
    323342        tmp->fieldLength = *((unsigned short*)&buffer2); 
     343        fprintf (stderr, "%hu) ", tmp->fieldLength); 
    324344        tmp->next = cTOPtr->fieldSet; 
    325345        tmp->prev = NULL; 
     
    331351      } 
    332352      while ((*offV9)%4 != 0) { 
     353        fprintf(stderr,"padding\n"); 
    333354        (*offV9)++; cpt++; 
    334355      } /*padding case*/ 
    335356    } 
    336357    (*cFNPtr)++; 
    337   } while ((cpt*2) < (length-3)); 
     358  } while ((cpt) < (length-2)); 
    338359/*   show_all_tplFlSet(); */ 
    339360  return length;