LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

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

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] Ask some question about head file in lvs
From: ". Cz" <cz2cza@xxxxxxxxx>
Date: Sat, 14 Jul 2012 15:19:00 +0800
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.
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

<Prev in Thread] Current Thread [Next in Thread>
  • [lvs-users] Ask some question about head file in lvs, . Cz <=