Diff for /src/usr.sbin/IPXrouted/tables.c between versions 1.2 and 1.3

version 1.2, 2003/06/17 04:29:52 version 1.3, 2004/03/11 09:38:59
Line 33 Line 33
  * SUCH DAMAGE.   * SUCH DAMAGE.
  *   *
  * $FreeBSD: src/usr.sbin/IPXrouted/tables.c,v 1.7 1999/08/28 01:15:05 peter Exp $   * $FreeBSD: src/usr.sbin/IPXrouted/tables.c,v 1.7 1999/08/28 01:15:05 peter Exp $
 * $DragonFly: src/usr.sbin/IPXrouted/tables.c,v 1.1 2003/06/16 07:16:25 dillon Exp $ * $DragonFly$
  *   *
  * @(#)tables.c 8.1 (Berkeley) 6/5/93   * @(#)tables.c 8.1 (Berkeley) 6/5/93
  */   */
Line 62  struct  rthash nethash[ROUTEHASHSIZ]; Line 62  struct  rthash nethash[ROUTEHASHSIZ];
  * Lookup dst in the tables for an exact match.   * Lookup dst in the tables for an exact match.
  */   */
 struct rt_entry *  struct rt_entry *
rtlookup(dst)rtlookup(struct sockaddr *dst)
        struct sockaddr *dst; 
 {  {
        register struct rt_entry *rt;        struct rt_entry *rt;
        register struct rthash *rh;        struct rthash *rh;
        register u_int hash;        u_int hash;
         struct afhash h;          struct afhash h;
   
         if (dst->sa_family >= AF_MAX)          if (dst->sa_family >= AF_MAX)
Line 88  rtlookup(dst) Line 87  rtlookup(dst)
  * Find a route to dst as the kernel would.   * Find a route to dst as the kernel would.
  */   */
 struct rt_entry *  struct rt_entry *
rtfind(dst)rtfind(struct sockaddr *dst)
        struct sockaddr *dst; 
 {  {
        register struct rt_entry *rt;        struct rt_entry *rt;
        register struct rthash *rh;        struct rthash *rh;
        register u_int hash;        u_int hash;
         struct afhash h;          struct afhash h;
         int af = dst->sa_family;          int af = dst->sa_family;
         int (*match)() = 0;          int (*match)() = 0;
Line 116  rtfind(dst) Line 114  rtfind(dst)
 }  }
   
 void  void
rtadd(dst, gate, metric, ticks, state)rtadd(struct sockaddr *dst, struct sockaddr *gate, short metric, short ticks,
        struct sockaddr *dst, *gate;      int state)
        short metric, ticks; 
        int state; 
 {  {
         struct afhash h;          struct afhash h;
        register struct rt_entry *rt;        struct rt_entry *rt;
         struct rthash *rh;          struct rthash *rh;
         int af = dst->sa_family, flags;          int af = dst->sa_family, flags;
         u_int hash;          u_int hash;
Line 169  rtadd(dst, gate, metric, ticks, state) Line 165  rtadd(dst, gate, metric, ticks, state)
 }  }
   
 void  void
rtadd_clone(ort, dst, gate, metric, ticks, state)rtadd_clone(struct rt_entry *ort, struct sockaddr *dst, struct sockaddr *gate,
        struct rt_entry *ort;            short metric, short ticks, int state)
        struct sockaddr *dst, *gate; 
        short metric, ticks; 
        int state; 
 {  {
         struct afhash h;          struct afhash h;
        register struct rt_entry *rt;        struct rt_entry *rt;
         struct rthash *rh;          struct rthash *rh;
         int af = dst->sa_family, flags;          int af = dst->sa_family, flags;
         u_int hash;          u_int hash;
Line 214  rtadd_clone(ort, dst, gate, metric, tick Line 207  rtadd_clone(ort, dst, gate, metric, tick
 }  }
   
 void  void
rtchange(rt, gate, metric, ticks)rtchange(struct rt_entry *rt, struct sockaddr *gate, short metric, short ticks)
        struct rt_entry *rt; 
        struct sockaddr *gate; 
        short metric, ticks; 
 {  {
         int doioctl = 0, metricchanged = 0;          int doioctl = 0, metricchanged = 0;
         struct rtuentry oldroute;          struct rtuentry oldroute;
Line 335  rtchange(rt, gate, metric, ticks) Line 325  rtchange(rt, gate, metric, ticks)
 }  }
   
 void  void
rtdelete(rt)rtdelete(struct rt_entry *rt)
        struct rt_entry *rt; 
 {  {
   
         struct sockaddr *sa = &(rt->rt_router);          struct sockaddr *sa = &(rt->rt_router);
   
         FIXLEN(sa);          FIXLEN(sa);
         sa = &(rt->rt_dst);          sa = &(rt->rt_dst);
         FIXLEN(sa);          FIXLEN(sa);
Line 370  rtdelete(rt) Line 359  rtdelete(rt)
 void  void
 rtinit(void)  rtinit(void)
 {  {
        register struct rthash *rh;        struct rthash *rh;
   
         for (rh = nethash; rh < &nethash[ROUTEHASHSIZ]; rh++)          for (rh = nethash; rh < &nethash[ROUTEHASHSIZ]; rh++)
                 rh->rt_forw = rh->rt_back = (struct rt_entry *)rh;                  rh->rt_forw = rh->rt_back = (struct rt_entry *)rh;
Line 378  rtinit(void) Line 367  rtinit(void)
 int seqno;  int seqno;
   
 int  int
rtioctl(action, ort)rtioctl(int action, struct rtuentry *ort)
        int action; 
        struct rtuentry *ort; 
 {  {
 #ifndef RTM_ADD  #ifndef RTM_ADD
         if (install == 0)          if (install == 0)

Removed from v.1.2  
changed lines
  Added in v.1.3