taglinefilesource code
rth194include/net/route.hstruct rtable * rth;
rth198include/net/route.hfor (rth=ip_rt_hash_table[ip_rt_hash_code(daddr)^local]; rth; rth=rth->rt_next)
rth200include/net/route.hif (rth->rt_dst == daddr)
rth202include/net/route.hrth->rt_lastuse = jiffies;
rth203include/net/route.hATOMIC_INCR(&rth->rt_use);
rth204include/net/route.hATOMIC_INCR(&rth->rt_refcnt);
rth206include/net/route.hreturn rth;
rth154net/ipv4/route.cstatic void rt_cache_add(unsigned hash, struct rtable * rth);
rth1048net/ipv4/route.cstruct rtable *rth, **rthp;
rth1057net/ipv4/route.cwhile ((rth = *rthp) != NULL)
rth1059net/ipv4/route.cstruct rtable * rth_next = rth->rt_next;
rth1066net/ipv4/route.cif (!rth->rt_refcnt && rth->rt_lastuse + RT_CACHE_TIMEOUT < now)
rth1072net/ipv4/route.cprintk("rt_check_expire clean %02x@%08x\n", i, rth->rt_dst);
rth1074net/ipv4/route.crt_free(rth);
rth1086net/ipv4/route.cif (rth->rt_lastuse + RT_CACHE_BUBBLE_THRESHOULD < rth_next->rt_lastuse ||
rth1087net/ipv4/route.c(rth->rt_lastuse < rth_next->rt_lastuse &&
rth1088net/ipv4/route.crth->rt_use < rth_next->rt_use))
rth1091net/ipv4/route.cprintk("rt_check_expire bubbled %02x@%08x<->%08x\n", i, rth->rt_dst, rth_next->rt_dst);
rth1095net/ipv4/route.crth->rt_next = rth_next->rt_next;
rth1096net/ipv4/route.crth_next->rt_next = rth;
rth1101net/ipv4/route.crthp = &rth->rt_next;
rth1143net/ipv4/route.cstruct rtable * rth, * next;
rth1150net/ipv4/route.cif (!(rth = ip_rt_hash_table[i]))
rth1159net/ipv4/route.cfor (; rth; rth=next)
rth1161net/ipv4/route.cnext = rth->rt_next;
rth1164net/ipv4/route.crth->rt_next = NULL;
rth1165net/ipv4/route.crt_free(rth);
rth1185net/ipv4/route.cstruct rtable * rth, **rthp;
rth1194net/ipv4/route.cfor (rthp=&ip_rt_hash_table[i]; (rth=*rthp); rthp=&rth->rt_next)
rth1196net/ipv4/route.cif (rth->rt_lastuse + expire*(rth->rt_refcnt+1) > now)
rth1200net/ipv4/route.c*rthp=rth->rt_next;
rth1201net/ipv4/route.crth->rt_next = NULL;
rth1203net/ipv4/route.crt_free(rth);
rth1373net/ipv4/route.cstatic void rt_cache_add(unsigned hash, struct rtable * rth)
rth1377net/ipv4/route.c__u32    daddr = rth->rt_dst;
rth1390net/ipv4/route.cif (rth->rt_dev->header_cache_bind)
rth1392net/ipv4/route.cstruct rtable * rtg = rth;
rth1394net/ipv4/route.cif (rth->rt_gateway != daddr)
rth1397net/ipv4/route.crtg = ip_rt_route(rth->rt_gateway, 0);
rth1403net/ipv4/route.cif (rtg == rth)
rth1409net/ipv4/route.crth->rt_hh = rtg->rt_hh;
rth1419net/ipv4/route.crth->rt_next = ip_rt_hash_table[hash];
rth1421net/ipv4/route.cif (rth->rt_next)
rth1425net/ipv4/route.cfor (trth=rth->rt_next; trth; trth=trth->rt_next)
rth1430net/ipv4/route.cip_rt_hash_table[hash] = rth;
rth1431net/ipv4/route.crthp = &rth->rt_next;
rth1439net/ipv4/route.cwhile ((rth = *rthp) != NULL)
rth1443net/ipv4/route.cif ((!rth->rt_refcnt && rth->rt_lastuse + RT_CACHE_TIMEOUT < now)
rth1444net/ipv4/route.c|| rth->rt_dst == daddr)
rth1446net/ipv4/route.c*rthp = rth->rt_next;
rth1450net/ipv4/route.cprintk("rt_cache clean %02x@%08x\n", hash, rth->rt_dst);
rth1452net/ipv4/route.crt_free(rth);
rth1456net/ipv4/route.crthp = &rth->rt_next;
rth1472net/ipv4/route.cstruct rtable * rth;
rth1481net/ipv4/route.crth = kmalloc(sizeof(struct rtable), GFP_ATOMIC);
rth1482net/ipv4/route.cif (!rth)
rth1505net/ipv4/route.ckfree_s(rth, sizeof(struct rtable));
rth1524net/ipv4/route.ckfree_s(rth, sizeof(struct rtable));
rth1528net/ipv4/route.crth->rt_dst  = daddr;
rth1529net/ipv4/route.crth->rt_src  = saddr;
rth1530net/ipv4/route.crth->rt_lastuse  = jiffies;
rth1531net/ipv4/route.crth->rt_refcnt  = 1;
rth1532net/ipv4/route.crth->rt_use  = 1;
rth1533net/ipv4/route.crth->rt_next  = NULL;
rth1534net/ipv4/route.crth->rt_hh  = NULL;
rth1535net/ipv4/route.crth->rt_gateway  = fi->fib_gateway;
rth1536net/ipv4/route.crth->rt_dev  = fi->fib_dev;
rth1537net/ipv4/route.crth->rt_mtu  = fi->fib_mtu;
rth1538net/ipv4/route.crth->rt_window  = fi->fib_window;
rth1539net/ipv4/route.crth->rt_irtt  = fi->fib_irtt;
rth1540net/ipv4/route.crth->rt_tos  = f->fib_tos;
rth1541net/ipv4/route.crth->rt_flags   = fi->fib_flags | RTF_HOST;
rth1543net/ipv4/route.crth->rt_flags   |= RTF_LOCAL;
rth1545net/ipv4/route.cif (!(rth->rt_flags & RTF_GATEWAY))
rth1546net/ipv4/route.crth->rt_gateway = rth->rt_dst;
rth1549net/ipv4/route.crt_cache_add(hash, rth);
rth1552net/ipv4/route.crt_free(rth);
rth1559net/ipv4/route.creturn rth;
rth1575net/ipv4/route.cstruct rtable * rth;
rth1579net/ipv4/route.cfor (rth=ip_rt_hash_table[ip_rt_hash_code(daddr)^local]; rth; rth=rth->rt_next)
rth1581net/ipv4/route.cif (rth->rt_dst == daddr)
rth1583net/ipv4/route.crth->rt_lastuse = jiffies;
rth1584net/ipv4/route.cATOMIC_INCR(&rth->rt_use);
rth1585net/ipv4/route.cATOMIC_INCR(&rth->rt_refcnt);
rth1587net/ipv4/route.creturn rth;