10 Nov, 2016

1 commit


16 Sep, 2014

1 commit


06 Mar, 2014

1 commit

  • Introduce packet mark support with new ip,mark hash set. This includes
    userspace and kernelspace code, hash:ip,mark set tests and man page
    updates.

    The intended use of ip,mark set is similar to the ip:port type, but for
    protocols which don't use a predictable port number. Instead of port
    number it matches a firewall mark determined by a layer 7 filtering
    program like opendpi.

    As well as allowing or blocking traffic it will also be used for
    accounting packets and bytes sent for each protocol.

    Signed-off-by: Jozsef Kadlecsik

    Vytas Dauksa
     

01 Oct, 2013

2 commits


17 Jun, 2011

1 commit

  • The hash:net,iface type makes possible to store network address and
    interface name pairs in a set. It's mostly suitable for egress
    and ingress filtering. Examples:

    # ipset create test hash:net,iface
    # ipset add test 192.168.0.0/16,eth0
    # ipset add test 192.168.0.0/24,eth1

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     

01 Feb, 2011

11 commits

  • The module implements the list:set type support in two flavours:
    without and with timeout. The sets has two sides: for the userspace,
    they store the names of other (non list:set type of) sets: one can add,
    delete and test set names. For the kernel, it forms an ordered union of
    the member sets: the members sets are tried in order when elements are
    added, deleted and tested and the process stops at the first success.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:net,port type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are two dimensional: IPv4/IPv6 network address/prefix and protocol/port
    pairs.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:net type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are one dimensional: IPv4/IPv6 network address/prefixes.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:ip,port,net type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are three dimensional: IPv4/IPv6 address, protocol/port and IPv4/IPv6
    network address/prefix triples. The different prefixes are searched/matched
    from the longest prefix to the shortes one (most specific to least).
    In other words the processing time linearly grows with the number of
    different prefixes in the set.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:ip,port,ip type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are three dimensional: IPv4/IPv6 address, protocol/port and IPv4/IPv6
    address triples.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:ip,port type support in four flavours:
    for IPv4 and IPv6, both without and with timeout support. The elements
    are two dimensional: IPv4/IPv6 address and protocol/port pairs. The port
    is interpeted for TCP, UPD, ICMP and ICMPv6 (at the latters as type/code
    of course).

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the hash:ip type support in four flavours:
    for IPv4 or IPv6, both without and with timeout support.

    All the hash types are based on the "array hash" or ahash structure
    and functions as a good compromise between minimal memory footprint
    and speed. The hashing uses arrays to resolve clashes. The hash table
    is resized (doubled) when searching becomes too long. Resizing can be
    triggered by userspace add commands only and those are serialized by
    the nfnl mutex. During resizing the set is read-locked, so the only
    possible concurrent operations are the kernel side readers. Those are
    protected by RCU locking.

    Because of the four flavours and the other hash types, the functions
    are implemented in general forms in the ip_set_ahash.h header file
    and the real functions are generated before compiling by macro expansion.
    Thus the dereferencing of low-level functions and void pointer arguments
    could be avoided: the low-level functions are inlined, the function
    arguments are pointers of type-specific structures.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the bitmap:port type in two flavours, without
    and with timeout support to store TCP/UDP ports from a range.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the bitmap:ip,mac set type in two flavours,
    without and with timeout support. In this kind of set one can store
    IPv4 address and (source) MAC address pairs. The type supports elements
    added without the MAC part filled out: when the first matching from kernel
    happens, the MAC part is automatically filled out. The timing out of the
    elements stars when an element is complete in the IP,MAC pair.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The module implements the bitmap:ip set type in two flavours, without
    and with timeout support. In this kind of set one can store IPv4
    addresses (or network addresses) from a given range.

    In order not to waste memory, the timeout version does not rely on
    the kernel timer for every element to be timed out but on garbage
    collection. All set types use this mechanism.

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik
     
  • The patch adds the IP set core support to the kernel.

    The IP set core implements a netlink (nfnetlink) based protocol by which
    one can create, destroy, flush, rename, swap, list, save, restore sets,
    and add, delete, test elements from userspace. For simplicity (and backward
    compatibilty and for not to force ip(6)tables to be linked with a netlink
    library) reasons a small getsockopt-based protocol is also kept in order
    to communicate with the ip(6)tables match and target.

    The netlink protocol passes all u16, etc values in network order with
    NLA_F_NET_BYTEORDER flag. The protocol enforces the proper use of the
    NLA_F_NESTED and NLA_F_NET_BYTEORDER flags.

    For other kernel subsystems (netfilter match and target) the API contains
    the functions to add, delete and test elements in sets and the required calls
    to get/put refereces to the sets before those operations can be performed.

    The set types (which are implemented in independent modules) are stored
    in a simple RCU protected list. A set type may have variants: for example
    without timeout or with timeout support, for IPv4 or for IPv6. The sets
    (i.e. the pointers to the sets) are stored in an array. The sets are
    identified by their index in the array, which makes possible easy and
    fast swapping of sets. The array is protected indirectly by the nfnl
    mutex from nfnetlink. The content of the sets are protected by the rwlock
    of the set.

    There are functional differences between the add/del/test functions
    for the kernel and userspace:

    - kernel add/del/test: works on the current packet (i.e. one element)
    - kernel test: may trigger an "add" operation in order to fill
    out unspecified parts of the element from the packet (like MAC address)
    - userspace add/del: works on the netlink message and thus possibly
    on multiple elements from the IPSET_ATTR_ADT container attribute.
    - userspace add: may trigger resizing of a set

    Signed-off-by: Jozsef Kadlecsik
    Signed-off-by: Patrick McHardy

    Jozsef Kadlecsik