|
enum | SocketType {
SOCKET_TYPE_UNUSED = 0,
SOCKET_TYPE_STREAM = 1,
SOCKET_TYPE_DGRAM = 2,
SOCKET_TYPE_RAW_IP = 3,
SOCKET_TYPE_RAW_ETH = 4
} |
| Socket types. More...
|
|
enum | SocketIpProtocol {
SOCKET_IP_PROTO_ICMP = 1,
SOCKET_IP_PROTO_IGMP = 2,
SOCKET_IP_PROTO_TCP = 6,
SOCKET_IP_PROTO_UDP = 17,
SOCKET_IP_PROTO_ICMPV6 = 58
} |
| IP protocols. More...
|
|
enum | SocketEthProtocol {
SOCKET_ETH_PROTO_ALL = 0x0000,
SOCKET_ETH_PROTO_LLC = 0x05DC,
SOCKET_ETH_PROTO_IPV4 = 0x0800,
SOCKET_ETH_PROTO_ARP = 0x0806,
SOCKET_ETH_PROTO_IPV6 = 0x86DD,
SOCKET_ETH_PROTO_EAPOL = 0x888E,
SOCKET_ETH_PROTO_LLDP = 0x88CC,
SOCKET_ETH_PROTO_PTP = 0x88F7
} |
| Ethernet protocols. More...
|
|
enum | SocketFlags {
SOCKET_FLAG_PEEK = 0x0200,
SOCKET_FLAG_DONT_ROUTE = 0x0400,
SOCKET_FLAG_WAIT_ALL = 0x0800,
SOCKET_FLAG_DONT_WAIT = 0x0100,
SOCKET_FLAG_BREAK_CHAR = 0x1000,
SOCKET_FLAG_BREAK_CRLF = 0x100A,
SOCKET_FLAG_WAIT_ACK = 0x2000,
SOCKET_FLAG_NO_DELAY = 0x4000,
SOCKET_FLAG_DELAY = 0x8000
} |
| Flags used by I/O functions. More...
|
|
enum | SocketShutdownFlags { SOCKET_SD_RECEIVE = 0,
SOCKET_SD_SEND = 1,
SOCKET_SD_BOTH = 2
} |
| Flags used by shutdown function. More...
|
|
enum | SocketEvent {
SOCKET_EVENT_NONE = 0x0000,
SOCKET_EVENT_ACCEPT = 0x0001,
SOCKET_EVENT_CONNECTED = 0x0002,
SOCKET_EVENT_CLOSED = 0x0004,
SOCKET_EVENT_TX_READY = 0x0008,
SOCKET_EVENT_TX_DONE = 0x0010,
SOCKET_EVENT_TX_ACKED = 0x0020,
SOCKET_EVENT_TX_SHUTDOWN = 0x0040,
SOCKET_EVENT_RX_READY = 0x0080,
SOCKET_EVENT_RX_SHUTDOWN = 0x0100,
SOCKET_EVENT_LINK_UP = 0x0200,
SOCKET_EVENT_LINK_DOWN = 0x0400
} |
| Socket events. More...
|
|
enum | SocketOptions {
SOCKET_OPTION_REUSE_ADDR = 0x0001,
SOCKET_OPTION_BROADCAST = 0x0002,
SOCKET_OPTION_IPV4_MULTICAST_LOOP = 0x0004,
SOCKET_OPTION_IPV4_DONT_FRAG = 0x0008,
SOCKET_OPTION_IPV4_PKT_INFO = 0x0010,
SOCKET_OPTION_IPV4_RECV_TOS = 0x0020,
SOCKET_OPTION_IPV4_RECV_TTL = 0x0040,
SOCKET_OPTION_IPV6_MULTICAST_LOOP = 0x0080,
SOCKET_OPTION_IPV6_ONLY = 0x0100,
SOCKET_OPTION_IPV6_DONT_FRAG = 0x0200,
SOCKET_OPTION_IPV6_PKT_INFO = 0x0400,
SOCKET_OPTION_IPV6_RECV_TRAFFIC_CLASS = 0x0800,
SOCKET_OPTION_IPV6_RECV_HOP_LIMIT = 0x1000,
SOCKET_OPTION_TCP_NO_DELAY = 0x2000,
SOCKET_OPTION_UDP_NO_CHECKSUM = 0x4000
} |
| Socket options. More...
|
|
enum | HostType { HOST_TYPE_ANY = 0,
HOST_TYPE_IPV4 = 16,
HOST_TYPE_IPV6 = 32
} |
| Host types. More...
|
|
enum | HostnameResolver {
HOST_NAME_RESOLVER_ANY = 0,
HOST_NAME_RESOLVER_DNS = 1,
HOST_NAME_RESOLVER_MDNS = 2,
HOST_NAME_RESOLVER_NBNS = 4,
HOST_NAME_RESOLVER_LLMNR = 8
} |
| Name resolution protocols. More...
|
|
|
error_t | socketInit (void) |
| Socket related initialization. More...
|
|
Socket * | socketOpen (uint_t type, uint_t protocol) |
| Create a socket (UDP or TCP) More...
|
|
error_t | socketSetTimeout (Socket *socket, systime_t timeout) |
| Set timeout value for blocking operations. More...
|
|
error_t | socketSetTtl (Socket *socket, uint8_t ttl) |
| Set TTL value for unicast datagrams. More...
|
|
error_t | socketSetMulticastTtl (Socket *socket, uint8_t ttl) |
| Set TTL value for multicast datagrams. More...
|
|
error_t | socketSetDscp (Socket *socket, uint8_t dscp) |
| Set DSCP field. More...
|
|
error_t | socketSetVlanPcp (Socket *socket, uint8_t pcp) |
| Set VLAN priority. More...
|
|
error_t | socketSetVlanDei (Socket *socket, bool_t dei) |
| Set VLAN DEI flag. More...
|
|
error_t | socketSetVmanPcp (Socket *socket, uint8_t pcp) |
| Set VMAN priority. More...
|
|
error_t | socketSetVmanDei (Socket *socket, bool_t dei) |
| Set VMAN DEI flag. More...
|
|
error_t | socketEnableBroadcast (Socket *socket, bool_t enabled) |
| Enable reception of broadcast messages. More...
|
|
error_t | socketJoinMulticastGroup (Socket *socket, const IpAddr *groupAddr) |
| Join the specified host group. More...
|
|
error_t | socketLeaveMulticastGroup (Socket *socket, const IpAddr *groupAddr) |
| Leave the specified host group. More...
|
|
error_t | socketSetMulticastSourceFilter (Socket *socket, const IpAddr *groupAddr, IpFilterMode filterMode, const IpAddr *sources, uint_t numSources) |
| Set multicast source filter (full-state API) More...
|
|
error_t | socketGetMulticastSourceFilter (Socket *socket, const IpAddr *groupAddr, IpFilterMode *filterMode, IpAddr *sources, uint_t *numSources) |
| Get multicast source filter. More...
|
|
error_t | socketAddMulticastSource (Socket *socket, const IpAddr *groupAddr, const IpAddr *srcAddr) |
| Accept specific source for specific group (delta-based API) More...
|
|
error_t | socketDropMulticastSource (Socket *socket, const IpAddr *groupAddr, const IpAddr *srcAddr) |
| Drop specific source for specific group (delta-based API) More...
|
|
error_t | socketBlockMulticastSource (Socket *socket, const IpAddr *groupAddr, const IpAddr *srcAddr) |
| Block specific source for specific group (delta-based API) More...
|
|
error_t | socketUnblockMulticastSource (Socket *socket, const IpAddr *groupAddr, const IpAddr *srcAddr) |
| Unblock specific source for specific group (delta-based API) More...
|
|
error_t | socketEnableKeepAlive (Socket *socket, bool_t enabled) |
| Enable TCP keep-alive. More...
|
|
error_t | socketSetKeepAliveParams (Socket *socket, systime_t idle, systime_t interval, uint_t maxProbes) |
| Set TCP keep-alive parameters. More...
|
|
error_t | socketSetMaxSegmentSize (Socket *socket, size_t mss) |
| Specify the maximum segment size for outgoing TCP packets. More...
|
|
error_t | socketSetTxBufferSize (Socket *socket, size_t size) |
| Specify the size of the TCP send buffer. More...
|
|
error_t | socketSetRxBufferSize (Socket *socket, size_t size) |
| Specify the size of the TCP receive buffer. More...
|
|
error_t | socketSetInterface (Socket *socket, NetInterface *interface) |
| Bind a socket to a particular network interface. More...
|
|
NetInterface * | socketGetInterface (Socket *socket) |
| Retrieve the underlying interface. More...
|
|
error_t | socketBind (Socket *socket, const IpAddr *localIpAddr, uint16_t localPort) |
| Associate a local address with a socket. More...
|
|
error_t | socketConnect (Socket *socket, const IpAddr *remoteIpAddr, uint16_t remotePort) |
| Establish a connection to a specified socket. More...
|
|
error_t | socketListen (Socket *socket, uint_t backlog) |
| Place a socket in the listening state. More...
|
|
Socket * | socketAccept (Socket *socket, IpAddr *clientIpAddr, uint16_t *clientPort) |
| Permit an incoming connection attempt on a socket. More...
|
|
error_t | socketSend (Socket *socket, const void *data, size_t length, size_t *written, uint_t flags) |
| Send data to a connected socket. More...
|
|
error_t | socketSendTo (Socket *socket, const IpAddr *destIpAddr, uint16_t destPort, const void *data, size_t length, size_t *written, uint_t flags) |
| Send a datagram to a specific destination. More...
|
|
error_t | socketSendMsg (Socket *socket, const SocketMsg *message, uint_t flags) |
| Send a message to a connectionless socket. More...
|
|
error_t | socketReceive (Socket *socket, void *data, size_t size, size_t *received, uint_t flags) |
| Receive data from a connected socket. More...
|
|
error_t | socketReceiveFrom (Socket *socket, IpAddr *srcIpAddr, uint16_t *srcPort, void *data, size_t size, size_t *received, uint_t flags) |
| Receive a datagram from a connectionless socket. More...
|
|
error_t | socketReceiveEx (Socket *socket, IpAddr *srcIpAddr, uint16_t *srcPort, IpAddr *destIpAddr, void *data, size_t size, size_t *received, uint_t flags) |
| Receive a datagram. More...
|
|
error_t | socketReceiveMsg (Socket *socket, SocketMsg *message, uint_t flags) |
| Receive a message from a connectionless socket. More...
|
|
error_t | socketGetLocalAddr (Socket *socket, IpAddr *localIpAddr, uint16_t *localPort) |
| Retrieve the local address for a given socket. More...
|
|
error_t | socketGetRemoteAddr (Socket *socket, IpAddr *remoteIpAddr, uint16_t *remotePort) |
| Retrieve the address of the peer to which a socket is connected. More...
|
|
error_t | socketShutdown (Socket *socket, uint_t how) |
| Disable reception, transmission, or both. More...
|
|
void | socketClose (Socket *socket) |
| Close an existing socket. More...
|
|
error_t | socketPoll (SocketEventDesc *eventDesc, uint_t size, OsEvent *extEvent, systime_t timeout) |
| Wait for one of a set of sockets to become ready to perform I/O. More...
|
|
error_t | getHostByName (NetInterface *interface, const char_t *name, IpAddr *ipAddr, uint_t flags) |
| Resolve a host name into an IP address. More...
|
|
Socket API.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Author
- Oryx Embedded SARL (www.oryx-embedded.com)
- Version
- 2.4.4
Definition in file socket.h.