• Jussi Laakkonen's avatar
    iptables: Introduce IPv6 iptables management. · 01d9e260
    Jussi Laakkonen authored
    This commit adds iptables management for IPv6 addresses. Existing
    src/iptables.c is used as base and the functionality to support IPv6
    iptables is included into existing code for the most part. Managing
    iptables using IPv6 addresses does not differ much from IPv4 use, only
    new structures of setting/getting rules have to be adapted into use. For
    each existing __connman_iptables_*() a type variable (int) has been
    added to indicate which address family (AF_INET/AF_INET6) is to be used.
    
    Functionality remains the same as with iptables.c, only the function
    parse_ipv6_and_mask() is rewritten comply with IPv6 address structures.
    Functions is_same_ipt_entry() and iptables_blob() are copied to use
    ip6t_* type structures.
    
    The internal structures connman_iptables_entry and connman_iptables
    were amended to include the iptables IPv6 structures and the address
    family type. In order to avoid copying of large amounts of existing code
    and to be able to use both IPv4 and IPv6 structures many existing
    functions are changed from using struct ipt_entry/ipt_ip/ipt_replace
    into using structures that contain pointers to both IPv4 and IPv6
    structures.
    
    Two new structures are introduced to act as containers for the IPv4 and
    IPv6 types of iptables structures:
     - struct iptables_ip contains ipt_ip and ip6t_ip + type
     - struct iptables_replace contains ipt_replace and ip6t_replace + type
     - struct connman_iptables_entry is used as container for ipt_entry and
    ip6t_entry
    
    Helper functions for getting content from struct connman_iptables were
    added to keep the code cleaner. Similarly for the struct
    iptables_replace helper functions were added. Helper functions were also
    added for getting content out of connman_iptables_entry struct.
    
    In order to operate both IPv4 and IPv6 iptables the initialization has
    to be done before each operation is executed if the IP type changes. For
    this setup_xtables() function was added to change the iptables type and
    to keep track of the current IP type to avoid unnecessary changes.
    01d9e260
Name
Last commit
Last update
..
client Loading commit data...
doc Loading commit data...
gdbus Loading commit data...
gdhcp Loading commit data...
gsupplicant Loading commit data...
gweb Loading commit data...
include Loading commit data...
m4 Loading commit data...
plugins Loading commit data...
scripts Loading commit data...
src Loading commit data...
test Loading commit data...
tools Loading commit data...
unit Loading commit data...
vpn Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
HACKING Loading commit data...
INSTALL Loading commit data...
Makefile.am Loading commit data...
Makefile.plugins Loading commit data...
NEWS Loading commit data...
README Loading commit data...
TODO Loading commit data...
acinclude.m4 Loading commit data...
bootstrap Loading commit data...
bootstrap-configure Loading commit data...
configure.ac Loading commit data...
connman.pc.in Loading commit data...