1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
* coap_tcp_internal.h -- TCP functions for libcoap
*
* Copyright (C) 2019--2020 Olaf Bergmann <bergmann@tzi.org> and others
*
* SPDX-License-Identifier: BSD-2-Clause
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
/**
* @file coap_tcp_internal.h
* @brief CoAP TCP internal information
*/
/**
* @ingroup internal_api
* @defgroup tcp TCP Support
* Internal API for handling CoAP TCP (RFC8283)
* @{
*/
/**
* Create a new TCP socket and initiate the connection
*
* Internal function.
*
* @param sock Where socket information is to be filled in
* @param local_if The local address to use or NULL
* @param server The address to connect to
* @param default_port The port to use if not set in @p server
* @param local_addr Filled in after connection initiation with
* the local address
* @param remote_addr Filled in after connection initiation with
* the remote address
*
* @return @c 1 if succesful, @c 0 if failure of some sort
*/
int
;
/**
* Complete the TCP Connection
*
* Internal function.
*
* @param sock The socket information to use
* @param local_addr Filled in with the final local address
* @param remote_addr Filled in with the final remote address
*
* @return @c 1 if succesful, @c 0 if failure of some sort
*/
int
;
/**
* Create a new TCP socket and then listen for new incoming TCP sessions
*
* Internal function.
*
* @param sock Where socket information is to be filled in
* @param listen_addr The address to be listening for new incoming sessions
* @param bound_addr Filled in with the address that the TCP layer
* is listening on for new incoming TCP sessions
*
* @return @c 1 if succesful, @c 0 if failure of some sort
*/
int
;
/**
* Accept a new incoming TCP session
*
* Internal function.
*
* @param server The socket information to use to accept the TCP connection
* @param new_client Filled in socket information with the new incoming
* session information
* @param local_addr Filled in with the local address
* @param remote_addr Filled in with the remote address
*
* @return @c 1 if succesful, @c 0 if failure of some sort
*/
int
;
/* !COAP_DISABLE_TCP */
/** @} */
/* COAP_TCP_INTERNAL_H_ */