java.lang.Object
org.apache.sshd.contrib.server.session.proxyprotocolv2.data.AddressData

public final class AddressData extends Object
Address data structure.

Starting from the 17th byte, addresses are presented in network byte order.

The address order is always the same : - source layer 3 address in network byte order - destination layer 3 address in network byte order - source layer 4 address if any, in network byte order (port) - destination layer 4 address if any, in network byte order (port)

The address block may directly be sent from or received into the following union which makes it easy to cast from/to the relevant socket native structs depending on the address type :

     union proxy_addr {
         struct {        // for TCP/UDP over IPv4, len = 12
             uint32_t src_addr;
             uint32_t dst_addr;
             uint16_t src_port;
             uint16_t dst_port;
         }ipv4_addr;
         struct{        // for TCP/UDP over IPv6, len = 36
             uint8_t src_addr[16];
             uint8_t dst_addr[16];
             uint16_t src_port;
             uint16_t dst_port;
         }ipv6_addr;
         struct{        // for AF_UNIX sockets, len = 216
             uint8_t src_addr[108];
             uint8_t dst_addr[108];
         }unix_addr;
     };