Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Data Structures | Macros | Typedefs | Functions
socket.h File Reference
#include <sys/types.h>
Include dependency graph for socket.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sockaddr
 
struct  sockaddr_storage
 
struct  in_addr
 
struct  sockaddr_in
 
struct  in6_addr
 
struct  sockaddr_in6
 
struct  msghdr
 

Macros

#define AF_UNSPEC   0
 
#define AF_UNIX   1
 
#define AF_INET   2
 
#define AF_INET6   10
 
#define PF_UNSPEC   AF_UNSPEC
 
#define PF_INET   AF_INET
 
#define PF_INET6   AF_INET6
 
#define SOCK_STREAM   1
 
#define SOCK_DGRAM   2
 
#define SOCK_RAW   3
 
#define SOCK_RDM   4
 
#define SOCK_SEQPACKET   5
 
#define SOL_SOCKET   1
 
#define SHUT_RD   0
 
#define SHUT_WR   1
 
#define SHUT_RDWR   2
 

Typedefs

typedef unsigned short sa_family_t
 

Functions

int socket (int domain, int type, int protocol)
 Create an endpoint for communication. More...
 
int bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen)
 Give the endpoint the address it answers on. More...
 
int listen (int sockfd, int backlog)
 Let the endpoint take the connections that arrive. More...
 
ssize_t sendto (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
 Send a message to the address given. More...
 

Detailed Description

Tenok has no network stack, only the types and constants are named

Function Documentation

◆ bind()

int bind ( int  sockfd,
const struct sockaddr addr,
socklen_t  addrlen 
)

Give the endpoint the address it answers on.

Parameters
sockfdThe endpoint.
addrThe address to answer on.
addrlenThe size of the address.
Return values
int-1 with errno set to ENOSYS.

◆ listen()

int listen ( int  sockfd,
int  backlog 
)

Let the endpoint take the connections that arrive.

Parameters
sockfdThe endpoint.
backlogHow many may wait to be taken.
Return values
int-1 with errno set to ENOSYS.

◆ sendto()

ssize_t sendto ( int  sockfd,
const void *  buf,
size_t  len,
int  flags,
const struct sockaddr dest_addr,
socklen_t  addrlen 
)

Send a message to the address given.

Parameters
sockfdThe endpoint to send from.
bufWhat to send.
lenHow much of it.
flagsHow to send it.
dest_addrWhere to send it.
addrlenThe size of the address.
Return values
ssize_t-1 with errno set to ENOSYS.

◆ socket()

int socket ( int  domain,
int  type,
int  protocol 
)

Create an endpoint for communication.

Parameters
domainThe family the endpoint speaks in.
typeHow it carries what is sent.
protocolWhich protocol of the family to use.
Return values
int-1 with errno set to ENOSYS.