Loading...
Searching...
No Matches
tcp.h File Reference

GNRC TCP API. More...

Detailed Description

GNRC TCP API.

Author
Simon Brummer simon.nosp@m..bru.nosp@m.mmer@.nosp@m.post.nosp@m.eo.de

Definition in file tcp.h.

#include <stdint.h>
#include "net/gnrc/pkt.h"
#include "net/gnrc/tcp/tcb.h"
#include "net/gnrc/ipv6.h"
+ Include dependency graph for tcp.h:

Go to the source code of this file.

Data Structures

struct  gnrc_tcp_ep_t
 Address information for a single TCP connection endpoint. More...
 

Macros

#define GNRC_TCP_NO_TIMEOUT   (UINT32_MAX)
 Special timeout value representing no timeout.
 

Functions

int gnrc_tcp_ep_init (gnrc_tcp_ep_t *ep, int family, const uint8_t *addr, size_t addr_size, uint16_t port, uint16_t netif)
 Initialize TCP connection endpoint.
 
int gnrc_tcp_ep_from_str (gnrc_tcp_ep_t *ep, const char *str)
 Construct TCP connection endpoint from string.
 
int gnrc_tcp_init (void)
 Initialize TCP.
 
void gnrc_tcp_tcb_init (gnrc_tcp_tcb_t *tcb)
 Initialize Transmission Control Block (TCB)
 
void gnrc_tcp_tcb_queue_init (gnrc_tcp_tcb_queue_t *queue)
 Initialize Transmission Control Block (TCB) queue.
 
int gnrc_tcp_open (gnrc_tcp_tcb_t *tcb, const gnrc_tcp_ep_t *remote, uint16_t local_port)
 Opens a connection.
 
int gnrc_tcp_listen (gnrc_tcp_tcb_queue_t *queue, gnrc_tcp_tcb_t *tcbs, size_t tcbs_len, const gnrc_tcp_ep_t *local)
 Configures a sequence of TCBs to wait for incoming connections.
 
int gnrc_tcp_accept (gnrc_tcp_tcb_queue_t *queue, gnrc_tcp_tcb_t **tcb, const uint32_t user_timeout_duration_ms)
 Accept TCP connection from listening queue.
 
ssize_t gnrc_tcp_send (gnrc_tcp_tcb_t *tcb, const void *data, const size_t len, const uint32_t user_timeout_duration_ms)
 Transmit data to connected peer.
 
ssize_t gnrc_tcp_recv (gnrc_tcp_tcb_t *tcb, void *data, const size_t max_len, const uint32_t user_timeout_duration_ms)
 Receive Data from the peer.
 
void gnrc_tcp_close (gnrc_tcp_tcb_t *tcb)
 Close a TCP connection.
 
void gnrc_tcp_abort (gnrc_tcp_tcb_t *tcb)
 Abort a TCP connection.
 
void gnrc_tcp_stop_listen (gnrc_tcp_tcb_queue_t *queue)
 Close connections and stop listening on TCB queue.
 
int gnrc_tcp_get_local (gnrc_tcp_tcb_t *tcb, gnrc_tcp_ep_t *ep)
 Get the local end point of a connected TCB.
 
int gnrc_tcp_get_remote (gnrc_tcp_tcb_t *tcb, gnrc_tcp_ep_t *ep)
 Get the remote end point of a connected TCB.
 
int gnrc_tcp_queue_get_local (gnrc_tcp_tcb_queue_t *queue, gnrc_tcp_ep_t *ep)
 Gets the local end point of a TCB queue.
 
int gnrc_tcp_calc_csum (const gnrc_pktsnip_t *hdr, const gnrc_pktsnip_t *pseudo_hdr)
 Calculate and set checksum in TCP header.
 
gnrc_pktsnip_tgnrc_tcp_hdr_build (gnrc_pktsnip_t *payload, uint16_t src, uint16_t dst)
 Adds a TCP header to a given payload.