Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/src/sm_at_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,12 @@ static int at_sec_sockopt_to_sockopt(enum at_sec_sockopt at_option, int *level,
case AT_TLS_DTLS_FRAG_EXT:
*option = NRF_SO_SEC_DTLS_FRAG_EXT;
break;
case AT_TLS_DTLS_CONN_SAVE:
*option = NRF_SO_SEC_DTLS_CONN_SAVE;
break;
case AT_TLS_DTLS_CONN_LOAD:
*option = NRF_SO_SEC_DTLS_CONN_LOAD;
break;
default:
LOG_WRN("Unsupported option: %d", at_option);
return -ENOTSUP;
Expand Down
10 changes: 6 additions & 4 deletions app/src/sm_sockopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ enum at_sec_sockopt {
AT_TLS_PEER_VERIFY = 5,
AT_TLS_SESSION_CACHE = 12,
AT_TLS_SESSION_CACHE_PURGE = 13,
AT_TLS_DTLS_CID = 14,
AT_TLS_DTLS_CID_STATUS = 15,
AT_TLS_DTLS_HANDSHAKE_TIMEO = 18,
AT_TLS_DTLS_FRAG_EXT = 22
AT_TLS_DTLS_HANDSHAKE_TIMEO = 14,
AT_TLS_DTLS_CID = 15,
AT_TLS_DTLS_CID_STATUS = 16,
AT_TLS_DTLS_CONN_SAVE = 17,
AT_TLS_DTLS_CONN_LOAD = 18,
AT_TLS_DTLS_FRAG_EXT = 20
};

/** @} */
Expand Down
34 changes: 27 additions & 7 deletions doc/app/at_socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,12 @@ Syntax

* ``<value>`` can be any integer value.

* ``14`` - ``AT_TLS_DTLS_CID`` (set-only).
* ``14`` - ``AT_TLS_DTLS_HANDSHAKE_TIMEO``.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will try everything to avoid breaking the API. This is a case where I don't think we have justification for doing it.

I believe this value is originating from zephyr/include/zephyr/net/socket.h:
#define TLS_DTLS_CID 14

Nowadays the defines have ZSOCK_ prefix.


* ``<value>`` is an integer that indicates the DTLS handshake timeout in seconds.
It can be one of the following values: ``1``, ``3``, ``7``, ``15``, ``31``, ``63``, ``123``.

* ``15`` - ``AT_TLS_DTLS_CID`` (set-only).

* ``<value>`` is an integer that indicates the DTLS connection identifier setting.
It can be one of the following values:
Expand All @@ -623,17 +628,33 @@ Syntax

See `NRF_SO_SEC_DTLS_CID <nrfxlib_dtls_cid_settings_>`_ for more details regarding the allowed values.

* ``15`` - ``AT_TLS_DTLS_CID_STATUS`` (get-only).
* ``16`` - ``AT_TLS_DTLS_CID_STATUS`` (get-only).
It is the DTLS connection identifier status.
It can be retrieved after the DTLS handshake.
See `NRF_SO_SEC_DTLS_CID_STATUS <nrfxlib_dtls_cid_status_>`_ for more details regarding the returned values.

* ``18`` - ``AT_TLS_DTLS_HANDSHAKE_TIMEO``.
* ``17`` - ``AT_TLS_DTLS_CONN_SAVE`` (set-only).
Write-only socket option to save DTLS connection.

* ``<value>`` is an integer that indicates the DTLS handshake timeout in seconds.
It can be one of the following values: ``1``, ``3``, ``7``, ``15``, ``31``, ``63``, ``123``.
* ``<value>`` must be set to ``0`` to save the DTLS connection state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't it so, that a value has to be provided, but it does not matter what it is? I think it's ok to say that the value must be set for example to 0, but the value for AT_TLS_DTLS_CONN_SAVE and AT_TLS_DTLS_CONN_LOAD should be the same. Now it isn't.

After this option is successfully called, you must call ``AT_TLS_DTLS_CONN_LOAD`` before continuing to communicate on the socket.

* ``22`` - ``AT_TLS_DTLS_FRAG_EXT``.
This is only supported by the following modem firmware:
* mfw_nrf9160 v1.3.5 or later
* mfw_nrf91x1
* mfw_nrf9151-ntn
Comment on lines +640 to +645
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is off, I think. These should be on the same level as the option (17/AT_TLS_DTLS_CONN_SAVE), not the value, right? It affects how the documentation is generated.

It looks like documentation is generated for an SM PR, but I couldn't find a link to it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation is not stored anywhere. It's just built for PRs. We use local building when needed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serial Modem doesn't support nrf9160. I don't think we need this note or the one for AT_TLS_DTLS_CONN_LOAD.


* ``18`` - ``AT_TLS_DTLS_CONN_LOAD`` (set-only).
Write-only socket option to load DTLS connection.

* ``<value>`` must be set to ``1`` to load the previously saved DTLS connection state.

This is only supported by the following modem firmware:
* mfw_nrf9160 v1.3.5 or later
* mfw_nrf91x1
* mfw_nrf9151-ntn
Comment on lines +652 to +655
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, correct the indentation.


* ``20`` - ``AT_TLS_DTLS_FRAG_EXT``.

* ``<value>`` is an integer that indicates the use of the DTLS fragmentation extension specified in RFC 6066.
It can be one of the following values:
Expand All @@ -643,7 +664,6 @@ Syntax
* ``2`` - ``DTLS_FRAG_EXT_1024_ENABLED``.

This is only supported by the following modem firmware:

* mfw_nrf91x1 v2.0.4 or later
* mfw_nrf9151-ntn
Comment on lines 666 to 668
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Expand Down