Exemple #1
0
int add_receive_rep(struct sk_buff *skb) {
  struct add_rep_pkt *pkt;

  printk(KERN_INFO "add: add_receive_rep called\n");
  pkt = (struct add_rep_pkt *) skb_network_header(skb);

  /* packet detsined for us! */
  if (pkt->dst_id == add_id) {
 	  return process_rep(skb);
  }

  /* not us, just keep on routing it! */
  return route_to_node(pkt->dst_id, pkt->dst_controller, skb);
}
void setup_reps (int *reps, int nmr_of_reps, int *orbit_length,
                 int **perms, int *a, int *b, char *c, int ***auts, 
                 FILE *descendant_file, FILE *covers_file,
                 struct pga_vars *pga, struct pcp_vars *pcp)
{ 

   char *d;                     /* used in stabiliser computation */
   FILE * tmp_file;
   struct pga_vars original;    /* copy of pga structure */
   register int i;
   Logical soluble_group;       /* indicates that stabilisers may 
				   be computed using soluble machinery */

#ifdef HAVE_GMP
   MP_INT original_aut;         /* copy of automorphism order */
#endif 

   soluble_group = (pga->soluble || pga->Degree == 1 || pga->nmr_of_perms == 0);

   tmp_file = TemporaryFile ();
   save_pcp (tmp_file, pcp);

   if (soluble_group) {
      d = find_permutation (b, c, pga);
      if (pga->print_stabiliser_array) {
	 printf ("The array D is \n"); 
	 print_chars (d, 1, pga->nmr_subgroups + 1);
      }
   }

#ifdef HAVE_GMP
   /* first record current automorphism group order */
   mpz_init_set (&original_aut, &pga->aut_order);
   mpz_clear (&pga->aut_order);
#endif 

   /* keep copy of pga */
   original = *pga;

#ifdef HAVE_GMP
   /* now reset automorphism order in pga */
   mpz_init_set (&pga->aut_order, &original_aut);
#endif 

   for (i = 1; i <= nmr_of_reps; ++i) {

      pga->fixed = pga->s;

      if (pga->final_stage) {
	 ++original.nmr_of_descendants;
	 update_name (pcp->ident, original.nmr_of_descendants, pga->s);
      }

      process_rep (perms, a, b, c, d, auts, reps[i], orbit_length[i], 
		   tmp_file, descendant_file, covers_file, pga, pcp);

      if (pga->final_stage && pga->capable) { 
	 ++original.nmr_of_capables;
	 if (pga->trace) 
	    printf ("Capable group #%d\n", original.nmr_of_capables);
      }

      /* revert to original pga structure */
      if (!StandardPresentation) {
#ifdef HAVE_GMP
	 mpz_clear (&pga->aut_order);
#endif 

         *pga = original;                                                       

#ifdef HAVE_GMP
	 mpz_init_set (&pga->aut_order, &original_aut);
#endif 
      }
   }
   
   if (soluble_group)
      free (++d);

#ifdef HAVE_GMP
   mpz_clear (&original_aut);
#endif 

   CloseFile (tmp_file);
}