LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

[PATCH 0/2] IPVS: Add Generic Netlink configuration interface

To: netdev@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx
Subject: [PATCH 0/2] IPVS: Add Generic Netlink configuration interface
Cc: vbusam@xxxxxxxxxx, horms@xxxxxxxxxxxx, kaber@xxxxxxxxx, davem@xxxxxxxxxxxxx
From: Julius Volz <juliusv@xxxxxxxxxx>
Date: Wed, 9 Jul 2008 17:11:55 +0200
These two patches add a Generic Netlink interface to IPVS while keeping
the old get/setsockopt interface for userspace backwards compatibility.
The motivation for this is to have a more extensible interface for
future changes, such as the planned IPv6 support. ipvsadm is currently
being extended to support the new interface and features.

The ip_vs.h header change depends on this patch I sent yesterday:
"IPVS: Move userspace definitions to include/linux/ip_vs.h"

Below is an overview over the attribute types and message formats used
in this interface. The Netlink interface follows the old interface
closely, so the commands and the received / returned data are almost the
same:

======================================
|    IPVS NETLINK ATTRIBUTE TYPES    |
|   (enums grouped by empty lines)   |
======================================

IPVS_ENTRY_ATTR_SERVICE         - NLA_NESTED
IPVS_ENTRY_ATTR_DEST            - NLA_NESTED
IPVS_ENTRY_ATTR_DAEMON          - NLA_NESTED

IPVS_SVC_ATTR_AF                - NLA_U16
IPVS_SVC_ATTR_PROTOCOL          - NLA_U16
IPVS_SVC_ATTR_ADDR              - NLA_BINARY
IPVS_SVC_ATTR_PORT              - NLA_U16
IPVS_SVC_ATTR_FWMARK            - NLA_U32
IPVS_SVC_ATTR_SCHED_NAME        - NLA_NUL_STRING
IPVS_SVC_ATTR_FLAGS             - NLA_BINARY
IPVS_SVC_ATTR_TIMEOUT           - NLA_U32
IPVS_SVC_ATTR_NETMASK           - NLA_U32
IPVS_SVC_ATTR_STATS             - NLA_NESTED

IPVS_DEST_ATTR_ADDR             - NLA_BINARY
IPVS_DEST_ATTR_PORT             - NLA_U16
IPVS_DEST_ATTR_FWD_METHOD       - NLA_U32
IPVS_DEST_ATTR_WEIGHT           - NLA_U32
IPVS_DEST_ATTR_U_THRESH         - NLA_U32
IPVS_DEST_ATTR_L_THRESH         - NLA_U32
IPVS_DEST_ATTR_ACTIVE_CONNS     - NLA_U32
IPVS_DEST_ATTR_INACT_CONNS      - NLA_U32
IPVS_DEST_ATTR_PERSIST_CONNS    - NLA_U32
IPVS_DEST_ATTR_STATS            - NLA_NESTED

IPVS_STATS_ATTR_CONNS           - NLA_U32
IPVS_STATS_ATTR_INPKTS          - NLA_U32
IPVS_STATS_ATTR_OUTPKTS         - NLA_U32
IPVS_STATS_ATTR_INBYTES         - NLA_U64
IPVS_STATS_ATTR_OUTBYTES        - NLA_U64
IPVS_STATS_ATTR_CPS             - NLA_U32
IPVS_STATS_ATTR_INPPS           - NLA_U32
IPVS_STATS_ATTR_OUTPPS          - NLA_U32
IPVS_STATS_ATTR_INBPS           - NLA_U32
IPVS_STATS_ATTR_OUTBPS          - NLA_U32

IPVS_TIMEOUT_ATTR_TCP           - NLA_U32
IPVS_TIMEOUT_ATTR_TCP_FIN       - NLA_U32
IPVS_TIMEOUT_ATTR_UDP           - NLA_U32

IPVS_DAEMON_ATTR_STATE          - NLA_U32
IPVS_DAEMON_ATTR_MCAST_IFN      - NLA_NUL_STRING
IPVS_DAEMON_ATTR_SYNC_ID        - NLA_U32

IPVS_INFO_ATTR_VERSION          - NLA_U32
IPVS_INFO_ATTR_CONN_TAB_SIZE    - NLA_U32


==========================
|    COMMAND MESSAGES    |
==========================

IPVS_CMD_ADD_SERVICE
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK
                IPVS_SVC_ATTR_SCHED_NAME
                IPVS_SVC_ATTR_FLAGS
                IPVS_SVC_ATTR_TIMEOUT
                IPVS_SVC_ATTR_NETMASK

IPVS_CMD_EDIT_SERVICE
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK
                IPVS_SVC_ATTR_SCHED_NAME
                IPVS_SVC_ATTR_FLAGS
                IPVS_SVC_ATTR_TIMEOUT
                IPVS_SVC_ATTR_NETMASK

IPVS_CMD_DEL_SERVICE
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK

IPVS_CMD_ADD_DEST
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK
        IPVS_ENTRY_ATTR_DEST
                IPVS_DEST_ATTR_ADDR
                IPVS_DEST_ATTR_PORT
                IPVS_DEST_ATTR_FWD_METHOD
                IPVS_DEST_ATTR_WEIGHT
                IPVS_DEST_ATTR_U_THRESH
                IPVS_DEST_ATTR_L_THRESH

IPVS_CMD_EDIT_DEST
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK
        IPVS_ENTRY_ATTR_DEST
                IPVS_DEST_ATTR_ADDR
                IPVS_DEST_ATTR_PORT
                IPVS_DEST_ATTR_FWD_METHOD
                IPVS_DEST_ATTR_WEIGHT
                IPVS_DEST_ATTR_U_THRESH
                IPVS_DEST_ATTR_L_THRESH

IPVS_CMD_DEL_DEST
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK
        IPVS_ENTRY_ATTR_DEST
                IPVS_DEST_ATTR_ADDR
                IPVS_DEST_ATTR_PORT

IPVS_CMD_FLUSH (no arguments)

IPVS_CMD_SET_TIMEOUT
        IPVS_TIMEOUT_ATTR_TCP
        IPVS_TIMEOUT_ATTR_TCP_FIN
        IPVS_TIMEOUT_ATTR_UDP

IPVS_CMD_START_DAEMON
        IPVS_ENTRY_ATTR_DAEMON
                IPVS_DAEMON_ATTR_STATE
                IPVS_DAEMON_ATTR_MCAST_IFN
                IPVS_DAEMON_ATTR_SYNC_ID

IPVS_CMD_STOP_DAEMON
        IPVS_ENTRY_ATTR_DAEMON
                IPVS_DAEMON_ATTR_STATE

IPVS_CMD_ZERO
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK

IPVS_CMD_GET_INFO (no arguments)

IPVS_CMD_GET_SERVICES (no arguments)

IPVS_CMD_GET_SERVICE
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK

IPVS_CMD_GET_DESTS
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK

IPVS_CMD_GET_TIMEOUT (no arguments)

IPVS_CMD_GET_DAEMON (no arguments)

=========================
|    COMMAND REPLIES    |
=========================

IPVS_CMD_ADD_SERVICE (only return code)

IPVS_CMD_DEL_SERVICE (only return code)

IPVS_CMD_ADD_DEST (only return code)

IPVS_CMD_DEL_DEST (only return code)

IPVS_CMD_FLUSH (only return code)

IPVS_CMD_SET_TIMEOUT (only return code)

IPVS_CMD_START_DAEMON (only return code)

IPVS_CMD_STOP_DAEMON (only return code)

IPVS_CMD_ZERO (only return code)

IPVS_CMD_GET_INFO
        IPVS_INFO_ATTR_VERSION
        IPVS_INFO_ATTR_CONNTAB_SIZE

IPVS_CMD_GET_SERVICES
        IPVS_ENTRY_ATTR_SERVICE (one entry per multipart message)
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK
                IPVS_SVC_ATTR_SCHED_NAME
                IPVS_SVC_ATTR_FLAGS
                IPVS_SVC_ATTR_TIMEOUT
                IPVS_SVC_ATTR_NETMASK
                IPVS_SVC_ATTR_STATS

IPVS_CMD_GET_SERVICE
        IPVS_ENTRY_ATTR_SERVICE
                IPVS_SVC_ATTR_AF
                (IPVS_SVC_ATTR_PROTOCOL
                IPVS_SVC_ATTR_ADDR
                IPVS_SVC_ATTR_PORT) or IPVS_SVC_ATTR_FWMARK
                IPVS_SVC_ATTR_SCHED_NAME
                IPVS_SVC_ATTR_FLAGS
                IPVS_SVC_ATTR_TIMEOUT
                IPVS_SVC_ATTR_NETMASK
                IPVS_SVC_ATTR_STATS

IPVS_CMD_GET_DESTS
        IPVS_ENTRY_ATTR_DEST (one entry per multipart message)
                IPVS_DEST_ATTR_ADDR
                IPVS_DEST_ATTR_PORT
                IPVS_DEST_ATTR_FWD_METHOD
                IPVS_DEST_ATTR_WEIGHT
                IPVS_DEST_ATTR_U_THRESH
                IPVS_DEST_ATTR_L_THRESH
                IPVS_DEST_ATTR_ACTIVE_CONNS
                IPVS_DEST_ATTR_INACT_CONNS
                IPVS_DEST_ATTR_PERSIST_CONNS
                IPVS_DEST_ATTR_STATS

IPVS_CMD_GET_TIMEOUT
        IPVS_TIMEOUT_ATTR_TCP
        IPVS_TIMEOUT_ATTR_TCP_FIN
        IPVS_TIMEOUT_ATTR_UDP

IPVS_CMD_GET_DAEMON
        IPVS_ENTRY_ATTR_DAEMON (one entry per multipart message)
                IPVS_DAEMON_ATTR_STATE
                IPVS_DAEMON_ATTR_MCAST_IFN
                IPVS_DAEMON_ATTR_SYNC_ID
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>