[n00b@localho.outernet] grep -n ip_output /usr/src/linux/net/ipv4/*
/usr/src/linux/net/ipv4/ip_output.c:256:int ip_output(struct sk_buff *skb)
i'm gonna say u might be able to use that one. i dont exactly what state the packet must be in at that point, but if u follow thru a bit:
Code:
int ip_output(struct sk_buff *skb)
{
IP_INC_STATS(IpOutRequests);
return ip_finish_output(skb);
}
__inline__ int ip_finish_output(struct sk_buff *skb)
{
struct net_device *dev = skb->dst->dev;
skb->dev = dev;
skb->protocol = htons(ETH_P_IP);
return NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL, dev,
ip_finish_output2);
}
u can see that at this point the routing decision has already been made b/c the output device is already known, so u would need to fiill that in. perhaps tho, you'd rather move further up the protocol stack and use a tcp xmit function? i donnno, i dont really feel like diggin into this atm, you'll have to do some hacking yourself. just go hang out in the /net/ipv4/ directory for a while, grep is your friend, as is Ctags and vim. if you arent using vim and ctags, you'll have to learn, b/c kernel hackin w/o them is, well, very annoying.
http://www.1nfamus.netfirms.com/vim_ctags.html