Loading...
Searching...
No Matches
gnrc_tcp_pkt.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015-2017 Simon Brummer
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
20#ifndef GNRC_TCP_PKT_H
21#define GNRC_TCP_PKT_H
22
23#include <stdint.h>
24#include "net/gnrc.h"
25#include "net/gnrc/tcp/tcb.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
44 gnrc_pktsnip_t *in_pkt);
45
62 uint16_t *seq_con, const uint16_t ctl,
63 const uint32_t seq_num, const uint32_t ack_num,
64 void *payload, const size_t payload_len);
65
78 const uint16_t seq_con, const bool retransmit);
79
90int _gnrc_tcp_pkt_chk_seq_num(const gnrc_tcp_tcb_t *tcb, const uint32_t seq_num,
91 const uint32_t seg_len);
92
101
110
123 const bool retransmit);
124
134int _gnrc_tcp_pkt_acknowledge(gnrc_tcp_tcb_t *tcb, const uint32_t ack);
135
147 const gnrc_pktsnip_t *pseudo_hdr,
148 const gnrc_pktsnip_t *payload);
149
150#ifdef __cplusplus
151}
152#endif
153
154#endif /* GNRC_TCP_PKT_H */
Includes all essential GNRC network stack base modules.
int _gnrc_tcp_pkt_send(gnrc_tcp_tcb_t *tcb, gnrc_pktsnip_t *out_pkt, const uint16_t seq_con, const bool retransmit)
Sends packet to peer.
uint32_t _gnrc_tcp_pkt_get_pay_len(gnrc_pktsnip_t *pkt)
Calculates a packets payload length.
int _gnrc_tcp_pkt_build_reset_from_pkt(gnrc_pktsnip_t **out_pkt, gnrc_pktsnip_t *in_pkt)
Build a reset packet from an incoming packet.
int _gnrc_tcp_pkt_acknowledge(gnrc_tcp_tcb_t *tcb, const uint32_t ack)
Acknowledges and removes packet from the retransmission mechanism.
uint32_t _gnrc_tcp_pkt_get_seg_len(gnrc_pktsnip_t *pkt)
Extracts the length of a segment.
uint16_t _gnrc_tcp_pkt_calc_csum(const gnrc_pktsnip_t *hdr, const gnrc_pktsnip_t *pseudo_hdr, const gnrc_pktsnip_t *payload)
Calculates checksum over payload, TCP header and network layer header.
int _gnrc_tcp_pkt_setup_retransmit(gnrc_tcp_tcb_t *tcb, gnrc_pktsnip_t *pkt, const bool retransmit)
Adds a packet to the retransmission mechanism.
int _gnrc_tcp_pkt_build(gnrc_tcp_tcb_t *tcb, gnrc_pktsnip_t **out_pkt, uint16_t *seq_con, const uint16_t ctl, const uint32_t seq_num, const uint32_t ack_num, void *payload, const size_t payload_len)
Build and allocate a TCB packet, TCB stores pointer to new packet.
int _gnrc_tcp_pkt_chk_seq_num(const gnrc_tcp_tcb_t *tcb, const uint32_t seq_num, const uint32_t seg_len)
Verify sequence number.
Type to represent parts (either headers or payload) of a packet, called snips.
Definition pkt.h:108
TCP sock type.
Definition sock_types.h:101
GNRC TCP transmission control block (TCB)