ã«ã¼ãã«ã¢ã¸ã¥ã¼ã«ãã¨ã¯ãã #3
ã©ã®ãªã¢ã«ãµã¼ãã«ãå²ãå½ã¦ãªãIPVSã®ã¹ã±ã¸ã¥ã¼ã©(!?)
# ãã£ããä½ã«å¯¾æãã¦ãã ï¼ä¿º(^^;;
# 5/29追è¨ã
大äºãªãã®å¿ãã¦ãï¼ï¼
register_ip_vs_scheduler() ã§æå®ãã¦ããæ§é ä½ãå®ç¾©ãã¦ãªãããï¼
ã¨ããããã§ã³ã¼ãã«è¿½è¨ãã¾ããã試ãã¦ã¿ã人ï¼ãããããï¼ããããªããã
ip_vs_test.c
#include <linux/module.h> #include <linux/kernel.h> #include <net/ip_vs.h> static int ip_vs_test_init_svc(struct ip_vs_service *svc) { IP_VS_DBG(7, "ip_vs_test: init_svc\n"); return 0; } static int ip_vs_test_done_svc(struct ip_vs_service *svc) { IP_VS_DBG(7, "ip_vs_test: done_svc\n"); return 0; } static int ip_vs_test_update_svc(struct ip_vs_service *svc) { IP_VS_DBG(7, "ip_vs_test: update_svc\n"); return 0; } static struct ip_vs_dest * ip_vs_test_schedule(struct ip_vs_service *svc, const struct sk_buff *skb) { IP_VS_DBG(7, "ip_vs_test_schedule(): Scheduling...\n"); return 0; } /*----- 5/29追è¨ã-----*/ static struct ip_vs_scheduler ip_vs_test_scheduler = { .name = "test", .refcnt = ATOMIC_INIT(0), .module = THIS_MODULE, .init_service = ip_vs_test_init_svc, .done_service = ip_vs_test_done_svc, .update_service = ip_vs_test_update_svc, .schedule = ip_vs_test_schedule, }; /*----- ããã¾ã§ -----*/ static int __init ip_vs_test_init(void) { /*----- 5/29追è¨ã-----*/ INIT_LIST_HEAD(&ip_vs_test_scheduler.n_list); /*----- ããã¾ã§ -----*/ return register_ip_vs_scheduler(&ip_vs_test_scheduler) ; } static void __exit ip_vs_test_cleanup(void) { unregister_ip_vs_scheduler(&ip_vs_test_scheduler); } module_init(ip_vs_test_init); module_exit(ip_vs_test_cleanup); MODULE_LICENSE("GPL");
ã¨ããããæä½éå¿
è¦ãªã®ã¯ããã ãã
ã¹ãã¼ãã«åããã«ã¯ net/ipv4/ipvs/Kconfig 㨠net/ipv4/ipvs/Makefile ãæ¸ãæããã®ã楽ããªã
ã¨ããããã¯ããã§
# ipvsadm -A -t 10.0.0.1:80 -s test
ã¨ãã§ããããã«ãªããã¨ã»ã»ã»