taglinefilesource code
rth242include/net/route.hstruct rtable * rth;
rth246include/net/route.hfor (rth=ip_rt_hash_table[ip_rt_hash_code(daddr)^local]; rth; rth=rth->rt_next)
rth248include/net/route.hif (rth->rt_dst == daddr)
rth250include/net/route.hrth->rt_lastuse = jiffies;
rth251include/net/route.hATOMIC_INCR(&rth->rt_use);
rth252include/net/route.hATOMIC_INCR(&rth->rt_refcnt);
rth254include/net/route.hreturn rth;
rth155net/ipv4/route.cstatic void rt_cache_add(unsigned hash, struct rtable * rth);
rth1050net/ipv4/route.cstruct rtable *rth, **rthp;
rth1059net/ipv4/route.cwhile ((rth = *rthp) != NULL)
rth1061net/ipv4/route.cstruct rtable * rth_next = rth->rt_next;
rth1068net/ipv4/route.cif (!rth->rt_refcnt && rth->rt_lastuse + RT_CACHE_TIMEOUT < now)
rth1074net/ipv4/route.cprintk("rt_check_expire clean %02x@%08x\n", i, rth->rt_dst);
rth1076net/ipv4/route.crt_free(rth);
rth1088net/ipv4/route.cif (rth->rt_lastuse + RT_CACHE_BUBBLE_THRESHOULD < rth_next->rt_lastuse ||
rth1089net/ipv4/route.c(rth->rt_lastuse < rth_next->rt_lastuse &&
rth1090net/ipv4/route.crth->rt_use < rth_next->rt_use))
rth1093net/ipv4/route.cprintk("rt_check_expire bubbled %02x@%08x<->%08x\n", i, rth->rt_dst, rth_next->rt_dst);
rth1097net/ipv4/route.crth->rt_next = rth_next->rt_next;
rth1098net/ipv4/route.crth_next->rt_next = rth;
rth1103net/ipv4/route.crthp = &rth->rt_next;
rth1145net/ipv4/route.cstruct rtable * rth, * next;
rth1152net/ipv4/route.cif (!(rth = ip_rt_hash_table[i]))
rth1161net/ipv4/route.cfor (; rth; rth=next)
rth1163net/ipv4/route.cnext = rth->rt_next;
rth1166net/ipv4/route.crth->rt_next = NULL;
rth1167net/ipv4/route.crt_free(rth);
rth1187net/ipv4/route.cstruct rtable * rth, **rthp;
rth1196net/ipv4/route.cfor (rthp=&ip_rt_hash_table[i]; (rth=*rthp); rthp=&rth->rt_next)
rth1198net/ipv4/route.cif (rth->rt_lastuse + expire*(rth->rt_refcnt+1) > now)
rth1202net/ipv4/route.c*rthp=rth->rt_next;
rth1203net/ipv4/route.crth->rt_next = NULL;
rth1205net/ipv4/route.crt_free(rth);
rth1375net/ipv4/route.cstatic void rt_cache_add(unsigned hash, struct rtable * rth)
rth1379net/ipv4/route.c__u32    daddr = rth->rt_dst;
rth1392net/ipv4/route.cif (rth->rt_dev->header_cache_bind)
rth1394net/ipv4/route.cstruct rtable * rtg = rth;
rth1396net/ipv4/route.cif (rth->rt_gateway != daddr)
rth1399net/ipv4/route.crtg = ip_rt_route(rth->rt_gateway, 0);
rth1405net/ipv4/route.cif (rtg == rth)
rth1411net/ipv4/route.crth->rt_hh = rtg->rt_hh;
rth1421net/ipv4/route.crth->rt_next = ip_rt_hash_table[hash];
rth1423net/ipv4/route.cif (rth->rt_next)
rth1427net/ipv4/route.cfor (trth=rth->rt_next; trth; trth=trth->rt_next)
rth1432net/ipv4/route.cip_rt_hash_table[hash] = rth;
rth1433net/ipv4/route.crthp = &rth->rt_next;
rth1441net/ipv4/route.cwhile ((rth = *rthp) != NULL)
rth1445net/ipv4/route.cif ((!rth->rt_refcnt && rth->rt_lastuse + RT_CACHE_TIMEOUT < now)
rth1446net/ipv4/route.c|| rth->rt_dst == daddr)
rth1448net/ipv4/route.c*rthp = rth->rt_next;
rth1452net/ipv4/route.cprintk("rt_cache clean %02x@%08x\n", hash, rth->rt_dst);
rth1454net/ipv4/route.crt_free(rth);
rth1458net/ipv4/route.crthp = &rth->rt_next;
rth1474net/ipv4/route.cstruct rtable * rth;
rth1483net/ipv4/route.crth = kmalloc(sizeof(struct rtable), GFP_ATOMIC);
rth1484net/ipv4/route.cif (!rth)
rth1510net/ipv4/route.ckfree_s(rth, sizeof(struct rtable));
rth1536net/ipv4/route.ckfree_s(rth, sizeof(struct rtable));
rth1540net/ipv4/route.crth->rt_dst  = daddr;
rth1541net/ipv4/route.crth->rt_src  = saddr;
rth1542net/ipv4/route.crth->rt_lastuse  = jiffies;
rth1543net/ipv4/route.crth->rt_refcnt  = 1;
rth1544net/ipv4/route.crth->rt_use  = 1;
rth1545net/ipv4/route.crth->rt_next  = NULL;
rth1546net/ipv4/route.crth->rt_hh  = NULL;
rth1547net/ipv4/route.crth->rt_gateway  = fi->fib_gateway;
rth1548net/ipv4/route.crth->rt_dev  = fi->fib_dev;
rth1549net/ipv4/route.crth->rt_mtu  = fi->fib_mtu;
rth1550net/ipv4/route.crth->rt_window  = fi->fib_window;
rth1551net/ipv4/route.crth->rt_irtt  = fi->fib_irtt;
rth1552net/ipv4/route.crth->rt_tos  = f->fib_tos;
rth1553net/ipv4/route.crth->rt_flags   = fi->fib_flags | RTF_HOST;
rth1555net/ipv4/route.crth->rt_flags   |= RTF_LOCAL;
rth1557net/ipv4/route.cif (!(rth->rt_flags & RTF_GATEWAY))
rth1558net/ipv4/route.crth->rt_gateway = rth->rt_dst;
rth1561net/ipv4/route.crt_cache_add(hash, rth);
rth1564net/ipv4/route.crt_free(rth);
rth1571net/ipv4/route.creturn rth;
rth1582net/ipv4/route.cstruct rtable * rth;
rth1586net/ipv4/route.cfor (rth=ip_rt_hash_table[ip_rt_hash_code(daddr)^local]; rth; rth=rth->rt_next)
rth1588net/ipv4/route.cif (rth->rt_dst == daddr)
rth1590net/ipv4/route.crth->rt_lastuse = jiffies;
rth1591net/ipv4/route.cATOMIC_INCR(&rth->rt_use);
rth1592net/ipv4/route.cATOMIC_INCR(&rth->rt_refcnt);
rth1594net/ipv4/route.creturn rth;