Mistake on this page?
Report an issue in GitHub or email us
DTLSSocketWrapper.h
Go to the documentation of this file.
1 /** @file DTLSSocketWrapper.h DTLSSocketWrapper */
2 /*
3  * Copyright (c) 2018 ARM Limited
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 /** @addtogroup netsocket
19 * @{
20 */
21 
22 #ifndef DTLSSOCKETWRAPPER_H
23 #define DTLSSOCKETWRAPPER_H
24 
25 #include "TLSSocketWrapper.h"
26 
27 // This class requires Mbed TLS SSL/TLS client code
28 #if defined(MBEDTLS_SSL_CLI_C) || defined(DOXYGEN_ONLY)
29 
30 /**
31  * \brief DTLSSocketWrapper implement DTLS stream over the existing Socket transport.
32  */
34 public:
35  /** Create a DTLSSocketWrapper.
36  *
37  * @param transport Underlying transport socket to wrap.
38  * @param hostname Hostname of the remote host, used for certificate checking.
39  * @param control Transport control mode. See @ref control_transport.
40  */
41  DTLSSocketWrapper(Socket *transport, const char *hostname = NULL, control_transport control = TRANSPORT_CONNECT_AND_CLOSE);
42 private:
43  static void timing_set_delay(void *ctx, uint32_t int_ms, uint32_t fin_ms);
44  static int timing_get_delay(void *ctx);
45  void timer_event();
46  uint64_t _int_ms_tick;
47  int _timer_event_id;
48  bool _timer_expired : 1;
49 };
50 
51 #endif
52 #endif
53 /** @} */
TLSSocket is a wrapper around Socket for interacting with TLS servers.
DTLSSocketWrapper(Socket *transport, const char *hostname=NULL, control_transport control=TRANSPORT_CONNECT_AND_CLOSE)
Create a DTLSSocketWrapper.
Socket interface.
Definition: Socket.h:39
Does call connect() and close() on transport socket.
control_transport
Transport modes.
TLSSocketWrapper.
DTLSSocketWrapper implement DTLS stream over the existing Socket transport.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.