Data Fields
sockaddr_in Struct Reference

IPv4 socket address. More...

#include <in.h>

Data Fields

sa_family_t sin_family
 Socket address family (part of struct sockaddr)
uint16_t sin_flags
 Flags (part of struct sockaddr_tcpip)
uint16_t sin_port
 TCP/IP port (part of struct sockaddr_tcpip)
uint16_t sin_scope_id
 Scope ID (part of struct sockaddr_tcpip)
struct in_addr sin_addr
 IPv4 address.
char pad [sizeof(struct sockaddr)-(sizeof(sa_family_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(struct in_addr))]

Detailed Description

IPv4 socket address.

Definition at line 82 of file in.h.

Field Documentation

Socket address family (part of struct sockaddr)

Always set to AF_INET for IPv4 addresses

Definition at line 87 of file in.h.

Referenced by dhcp_tx(), dns_xfer_deliver(), pxe_udp_deliver(), pxenv_udp_write(), slam_open(), start_dhcp(), and start_pxebs().

Flags (part of struct sockaddr_tcpip)

Definition at line 89 of file in.h.

Scope ID (part of struct sockaddr_tcpip)

For multicast addresses, this is the network device index.

Definition at line 96 of file in.h.

Referenced by ipv4_netdev(), and ipv4_tx().

char sockaddr_in::pad[sizeof(struct sockaddr)-(sizeof(sa_family_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(struct in_addr))]


This ensures that a struct sockaddr_in is large enough to hold a socket address for any TCP/IP address family.

Definition at line 109 of file in.h.

The documentation for this struct was generated from the following file: