Once initialized routing restrictions are found in the array of ipr_res_table structures called "ipr_restrictions". The index is the network number as found in the "net" struct (net.n_net -- network index number), perhaps it should be net.n_int (interface number), but looking at how these are initialized in gw/src/gate.c lead me to use n_net. "ipr_restrictions" is allocated in "initintabs" in gw/in/inrte.c, and initialized in "init_restrictions" which is called per net (1 to "nnets") from "initintabs". A routing protocol when running calls either res_ignore_route or res_advertise_route with a protocol number (currently either F_RES_RIP or F_RES_EGP, defined in gw/in/inrte.h), a network address, and an network index. The routing looks in "ipr_restrictions[net_index]" to find the appropriate info and looks up that network using the hash table stuff, return a take/punt or squawk/shut up decision. Do to the way "ipr_res_entry" is defined, you cannot have different restrictions on a given interface for more than one protocol. E.g. on interface 1 you cannot listen to 18.80.0.0 via RIP and also not announce it via EGP. This could be fixed by having a separate flag word per-protocol, but for now I wanted to keep it simple. Or you could allow more than one entry per network. This is probably what you want to do if you want to add an address field so you can distinguish among protocol speakers on a interface (would proably be most useful for EGP). You would have to modify the hash routines not to do lookups first on creates, and to take some more arguments for lookups (i.e. you have to skip by wrong protocol/addresses and keep checking until you come to the end of the hash chain or until you get a match). EGP doesn't use restrictions for advertising but does for incoming routes (though GW won't use it for now). The metric stuff is really intended to be used if EGP routes ever get turned into RIP routes.