Repository navigation
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
usage: patch -p0 < kxchg.patch.xxxxxxx
kxchg.patch.20130204 for linux 2.6.38
example:
#include <linux/types.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/in.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/netfilter.h>
#
4E39
include <linux/list.h>
#include <linux/kxchg.h>
static struct kxchg test;
extern int kxchg_register(struct kxchg *ptr);
extern int kxchg_unregister(struct kxchg *kxchg);
/*
* if there is a function named "do_rule_add"
* and if you want to exchange it by do_rule_add_test
*
* then
* declear the function as follows... this function args is same as the old functions ( do_rule_add)
*
*
*/
int do_rule_add_test(SG_RULE * r, int vsysid, struct rule_set *set)
{
printk("do_rule_test ... ok");
return 0;
}
int __init test_init(void)
{
memset(&test, 0x00, sizeof(test));
test.symbol_name="do_rule_add";
test.symbol_name_rep="do_rule_add_test";
kxchg_register(&test);
return 0;
}
void __exit test_exit(void)
{
kxchg_unregister(&test);
return;
}
module_init(test_init);
module_exit(test_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("cooboos");