Re: Ipset kernel module functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 23 Feb 2016, Gadre Nayan wrote:

> I am trying to understand the IPSET modules in linux kernel 4.3. 
> Particularly Macset. In the source file: 
> /net/netfilter/ipset/ip_set_hash_mac.c
> 
> I have few questions:
> 
> 1. What is the purpose of HTYPE, it is not getting used further.
> 
> /* Type specific function prefix */
>          #define HTYPE           hash_mac
> 
> 2. What is the purpose of MTYPE.
>           #define MTYPE           hash_mac4

Most of the functions are generated and the macros are used in the 
included ip_set_hash_gen.h file. HTYPE is used for the IPv4/IPv6 
independent functions while MTYPE required for the IPv4, IPv6 specific 
ones.

> 3. Why 2 different functions are used. KADT and UADT. I understand ADT
> is Add delete, Test and K and U might be Kernel space and User space.
> But what is different operation of KADT and UADT.

Those are the kernel and userspace common routines for add, del and test 
elements. The functions are separated because the input comes in different 
forms: in the userspace case in netlink attributes, while in the kernel 
case through the API.

> 4. Who calls Kadt in kernel space. How is UADT called from User space.

The kadt functions are called from the kernel part interfaces (ip_set_add, 
etc) while the uadt ones from ip_set_uadd, etc (see ip_set_core.c). Please 
note uadt functions are NOT called in userspace: the functions work on 
data sent FROM userspace.

Best regards,
Jozsef
-
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlecsik.jozsef@xxxxxxxxxxxxx
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux