Prefix *insert_a_node(Prefix *head,Prefix *node ){
    Prefix *cur = head ;
    if(head == NULL)
        return node ;
    if( node == NULL )
       return head ;
    if( node->IP < head->IP)
      { node->next = head ;
          return node ;  }
    while( cur->next != NULL && cur->next->IP <= node->IP)
        cur = cur->next ;
       node->next = cur->next ;
       cur->next = node ;
      return head ;
                       }
Prefix *build_list(){
   int a[4],len,i ;
   int ip = 0 ;
  Prefix *head = NULL ;
 FILE *ofp ;
 ofp = fopen("trace_file","r") ; //此處為讀取檔案的DATA
 while( fscanf(ofp,"%d.%d.%d.%d",&a[0],&a[1],&a[2],&a[3]) != EOF){
       Prefix *node = (Prefix*)malloc(sizeof(Prefix)) ;
  //       if(a[1] == 0)           此處為len 處理 個人認為無關問題所在
             node->len = 8 ;
         if(a[1] != 0 && a[2] == 0)
             node->len = 16 ;
         if(a[2] != 0 && a[3] == 0)
             node->len = 24 ;
         if(a[0]*a[1]*a[2]*a[3] != 0 )
             node->len =32 ;   //
   for ( i =0 ; i < 4 ; i++)
   {  ip = ip + a[i] ;
    if ( i != 3 )
      ip = ip<<8 ;  }
        node->IP = ip ;
        ip = 0 ;
     head = insert_a_node(head,node);
                                 }
   }
