nRF Connect SDK API 2.8.0
Loading...
Searching...
No Matches
pdn.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef PDN_H_
8#define PDN_H_
9
10#include <stdbool.h>
11#include <stddef.h>
12#include <stdint.h>
13#include <zephyr/net/net_ip.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
33
48 uint8_t nslpi;
54 uint8_t secure_pco;
55};
56
80
87
102typedef void (*pdn_event_handler_t)(uint8_t cid, enum pdn_event event, int reason);
103
116
128int pdn_ctx_configure(uint8_t cid, const char *apn, enum pdn_fam family,
129 struct pdn_pdp_opt *opts);
130
140int pdn_ctx_auth_set(uint8_t cid, enum pdn_auth method,
141 const char *user, const char *password);
142
151int pdn_ctx_destroy(uint8_t cid);
152
163int pdn_activate(uint8_t cid, int *esm, enum pdn_fam *family);
164
171int pdn_deactivate(uint8_t cid);
172
181int pdn_id_get(uint8_t cid);
182
193int pdn_dynamic_params_get(uint8_t cid, struct in_addr *dns4_pri,
194 struct in_addr *dns4_sec, unsigned int *ipv4_mtu);
195
205int pdn_default_apn_get(char *buf, size_t len);
206
213
220
221#if CONFIG_PDN_ESM_STRERROR
222
231const char *pdn_esm_strerror(int reason);
232
233#endif
234
237#ifdef __cplusplus
238}
239#endif
240
241#endif /* PDN_H_ */
int pdn_default_apn_get(char *buf, size_t len)
Retrieve the default Access Point Name (APN).
int pdn_ctx_configure(uint8_t cid, const char *apn, enum pdn_fam family, struct pdn_pdp_opt *opts)
Configure a Packet Data Protocol context.
pdn_fam
PDN family.
Definition pdn.h:27
@ PDN_FAM_IPV4
Definition pdn.h:28
@ PDN_FAM_IPV6
Definition pdn.h:29
@ PDN_FAM_NONIP
Definition pdn.h:31
@ PDN_FAM_IPV4V6
Definition pdn.h:30
int pdn_deactivate(uint8_t cid)
Deactivate a Packet Data Network (PDN) connection.
pdn_event
PDN library event.
Definition pdn.h:58
@ PDN_EVENT_APN_RATE_CONTROL_ON
Definition pdn.h:72
@ PDN_EVENT_APN_RATE_CONTROL_OFF
Definition pdn.h:74
@ PDN_EVENT_ACTIVATED
Definition pdn.h:62
@ PDN_EVENT_CNEC_ESM
Definition pdn.h:60
@ PDN_EVENT_DEACTIVATED
Definition pdn.h:64
@ PDN_EVENT_CTX_DESTROYED
Definition pdn.h:78
@ PDN_EVENT_IPV6_UP
Definition pdn.h:66
@ PDN_EVENT_IPV6_DOWN
Definition pdn.h:68
@ PDN_EVENT_NETWORK_DETACH
Definition pdn.h:70
int pdn_default_ctx_cb_dereg(pdn_event_handler_t cb)
Deregister a callback for events pertaining to the default PDP context (zero).
int pdn_ctx_create(uint8_t *cid, pdn_event_handler_t cb)
Create a Packet Data Protocol (PDP) context.
int pdn_dynamic_params_get(uint8_t cid, struct in_addr *dns4_pri, struct in_addr *dns4_sec, unsigned int *ipv4_mtu)
Retrieve dynamic parameters of a given PDP context.
pdn_auth
PDN authentication method.
Definition pdn.h:82
@ PDN_AUTH_CHAP
Definition pdn.h:85
@ PDN_AUTH_NONE
Definition pdn.h:83
@ PDN_AUTH_PAP
Definition pdn.h:84
int pdn_default_ctx_cb_reg(pdn_event_handler_t cb)
Register a callback for events pertaining to the default PDP context (zero).
int pdn_id_get(uint8_t cid)
Retrieve the PDN ID for a given PDP Context.
void(* pdn_event_handler_t)(uint8_t cid, enum pdn_event event, int reason)
Definition pdn.h:102
int pdn_activate(uint8_t cid, int *esm, enum pdn_fam *family)
Activate a Packet Data Network (PDN) connection.
int pdn_ctx_auth_set(uint8_t cid, enum pdn_auth method, const char *user, const char *password)
Set PDN connection authentication parameters.
int pdn_ctx_destroy(uint8_t cid)
Destroy a Packet Data Protocol context.
uint8_t ip4_addr_alloc
IPv4 address allocation. 0 – IPv4 address via Non-access Stratum (NAS) signaling (default) 1 – IPv4 a...
Definition pdn.h:41
uint8_t secure_pco
Protected transmission of Protocol Configuration Options (PCO). 0 – Protected transmission of PCO is ...
Definition pdn.h:54
uint8_t nslpi
NAS Signalling Low Priority Indication. 0 – Use Non-access Stratum (NAS) Signalling Low Priority Indi...
Definition pdn.h:48
Additional PDP Context configuration options.
Definition pdn.h:35