# sockets.h File Reference

`#include <ubixos/types.h>`

Go to the source code of this file.

## Data Structures

struct | in_addr
struct | sockaddr
struct | sockaddr_in

## Defines

#define | SOCK_STREAM 1
#define | SOCK_DGRAM 2
#define | AF_INET 2
#define | PF_INET AF_INET
#define | IPPROTO_TCP 6
#define | IPPROTO_UDP 17
#define | INADDR_ANY 0
#define | INADDR_BROADCAST 0xffffffff

## Functions

int | lwip_accept (int s, struct sockaddr *addr, int *addrlen)
int | lwip_bind (int s, struct sockaddr *name, int namelen)
int | lwip_close (int s)
int | lwip_connect (int s, struct sockaddr *name, int namelen)
int | lwip_listen (int s, int backlog)
int | lwip_recv (int s, void *mem, int len, unsigned int flags)
int | lwip_read (int s, void *mem, int len)
int | lwip_recvfrom (int s, void *mem, int len, unsigned int flags, struct sockaddr *from, int *fromlen)
int | lwip_send (int s, void *dataptr, int size, unsigned int flags)
int | lwip_sendto (int s, void *dataptr, int size, unsigned int flags, struct sockaddr *to, int tolen)
int | lwip_socket (int domain, int type, int protocol)
int | lwip_write (int s, void *dataptr, int size)

## Define Documentation

#define AF_INET 2

#define INADDR_ANY 0

#define INADDR_BROADCAST 0xffffffff

#define IPPROTO_TCP 6

#define IPPROTO_UDP 17

#define PF_INET AF_INET

#define SOCK_DGRAM 2

#define SOCK_STREAM 1

## Function Documentation

int lwip_accept | ( | int | s,
|  | struct sockaddr * | addr,
|  | int * | addrlen
| ) |

int lwip_bind | ( | int | s,
|  | struct sockaddr * | name,
|  | int | namelen
| ) |

int lwip_close | ( | int | s | ) |

int lwip_connect | ( | int | s,
|  | struct sockaddr * | name,
|  | int | namelen
| ) |

int lwip_listen | ( | int | s,
|  | int | backlog
| ) |

int lwip_read | ( | int | s,
|  | void * | mem,
|  | int | len
| ) |

int lwip_recv | ( | int | s,
|  | void * | mem,
|  | int | len,
|  | unsigned int | flags
| ) |

int lwip_recvfrom | ( | int | s,
|  | void * | mem,
|  | int | len,
|  | unsigned int | flags,
|  | struct sockaddr * | from,
|  | int * | fromlen
| ) |

int lwip_send | ( | int | s,
|  | void * | dataptr,
|  | int | size,
|  | unsigned int | flags
| ) |

int lwip_sendto | ( | int | s,
|  | void * | dataptr,
|  | int | size,
|  | unsigned int | flags,
|  | struct sockaddr * | to,
|  | int | tolen
| ) |

int lwip_socket | ( | int | domain,
|  | int | type,
|  | int | protocol
| ) |

int lwip_write | ( | int | s,
|  | void * | dataptr,
|  | int | size
| ) |