Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,9 @@ Modem libraries
* An issue where wrong APN rate control event was sent.
* An issue where a malformed +CGEV notification was not handled correctly.

* Removed the deprecated ``pdn_dynamic_params_get()`` function.
Use the :c:func:`pdn_dynamic_info_get` function instead.

Multiprotocol Service Layer libraries
-------------------------------------

Expand Down
15 changes: 0 additions & 15 deletions include/modem/pdn.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,21 +220,6 @@ int pdn_deactivate(uint8_t cid);
*/
int pdn_id_get(uint8_t cid);

/**
* @brief Retrieve dynamic parameters of a given PDN connection.
*
* @deprecated Use #pdn_dynamic_info_get instead.
*
* @param cid The PDP context ID.
* @param[out] dns4_pri The address of the primary IPv4 DNS server. Optional, can be NULL.
* @param[out] dns4_sec The address of the secondary IPv4 DNS server. Optional, can be NULL.
* @param[out] ipv4_mtu The IPv4 MTU. Optional, can be NULL.
*
* @return Zero on success or an error code on failure.
*/
__deprecated int pdn_dynamic_params_get(uint8_t cid, struct in_addr *dns4_pri,
struct in_addr *dns4_sec, unsigned int *ipv4_mtu);

/**
* @brief Retrieve dynamic parameters of a given PDN connection.
*
Expand Down
45 changes: 0 additions & 45 deletions lib/pdn/pdn.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,51 +635,6 @@ int pdn_id_get(uint8_t cid)
return strtoul(p + 1, NULL, 10);
}

int pdn_dynamic_params_get(uint8_t cid, struct in_addr *dns4_pri,
struct in_addr *dns4_sec, unsigned int *ipv4_mtu)
{
int matched;
const char *fmt;
unsigned int mtu;
char dns4_pri_str[INET_ADDRSTRLEN];
char dns4_sec_str[INET_ADDRSTRLEN];
char at_cmd[sizeof("AT+CGCONTRDP=###")];

if (snprintf(at_cmd, sizeof(at_cmd), AT_CMD_PDN_CONTEXT_READ_INFO, cid) >= sizeof(at_cmd)) {
return -E2BIG;
}

fmt = AT_CMD_PDN_CONTEXT_READ_INFO_PARSE_LINE1;

/* If IPv4 is enabled, it will be the first response line. */
matched = nrf_modem_at_scanf(at_cmd, fmt, &dns4_pri_str, &dns4_sec_str, &mtu);
/* Need to match at least the two IP addresses, or there is an error */
if (matched < 2) {
return -EBADMSG;
}

if (dns4_pri) {
if (zsock_inet_pton(AF_INET, dns4_pri_str, dns4_pri) != 1) {
return -EADDRNOTAVAIL;
}
}
if (dns4_sec) {
if (zsock_inet_pton(AF_INET, dns4_sec_str, dns4_sec) != 1) {
return -EADDRNOTAVAIL;
}
}
if (ipv4_mtu) {
/* If we matched the MTU, copy it here, otherwise report zero */
if (matched == 3) {
*ipv4_mtu = mtu;
} else {
*ipv4_mtu = 0;
}
}

return 0;
}

static int pdn_sa_family_from_ip_string(const char *src)
{
char buf[INET6_ADDRSTRLEN];
Expand Down