[lvs-users] Ask some question about head file in lvs

. Cz cz2cza at gmail.com
Sat Jul 14 08:19:00 BST 2012


Hi,

I want to ask some question about head file in ipvs

I found there are three path which the head file ip_vs.h is in.

One is libipvs2.6/ip_vs.h, other two is linux/ip_vs.h and net/ip_vs.h

I found the head file net/ip_vs.h is only used by ip_vs kernel.
linux/ip_vs.h is included by net/ip_vs.h. libipvs2.6 use its dedicated
ip_vs.h.

In generally speaking, linux/ip_vs.h is used for user application, but, why
libipvs2.6 prefer its dedicated ip_vs.h,  rather than linux/ip_vs.h?

Above issue make some data structure definition disorder such as data
structure used for communication between user application and ip_vs kernel
module.

For example:

*Data struct ip_vs_service_entry_kern:* linux/ip_vs.h and
libipvs2.6/ip_vs.h all had defined this data structure, they have similar
content.

*In set control process:  *User application call such function like
ipvs_update_service, this function will fill some information in *
ip_vs_service_user*, then use setsockopt to send part of this data struct
to kernel module because the send length is sizeof(struct ip_vs_service_kern),
whcih is defined in libipvs2.6/ip_vs.h. When ip_vs kernel module receive
the msg, it will use struct *ip_vs_service_user* which is defined in
linux/ip_vs.h to put the msg content in. The data structure *
ip_vs_service_user* in libipvs2.6/ip_vs.h and linux/ip_vs.h have different
content but named same. And data structure ip_vs_service_kernel in
libipvs2.6/ip_vs.h is only used for get length.

So, I am very puzzled on it.

It is very kind of you to tell me the reason why we implemented so. Very
thanks for you. :)


Cz.



More information about the lvs-users mailing list