#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define err(msg) printk(KERN_INFO "%s failed.\n", msg)
static int __init main_init(void)
{
struct rtable *rt = NULL;
struct flowi fl = {
.oif = 0,
.nl_u = {
.ip4_u = {
.daddr = 0x11223344,
.saddr = 0,
.tos = 0,
}
},
};
if (ip_route_output_flow(&rt, &fl, NULL, 0) < 0) {
err("ip_route_output_flow");
goto out;
}
printk(KERN_INFO "route search successful.\n");
if (rt)
ip_rt_put(rt);
return 0;
out:
return -1;
}
static void __exit main_exit(void)
{
}
module_init(main_init);
module_exit(main_exit);
MODULE_LICENSE("GPL");
阅读(1999) | 评论(0) | 转发(0) |