Skip to content

Commit 3e4318f

Browse files
gbakkembolivar-nordic
authored andcommitted
[nrf noup]: include: net: Align with bsdlib defines.
Adding socket family type AF_LOCAL. Adding socket type SOCK_MGMT used in conjuction with with AF_LTE. Adding socket protocol NPROTO_PDN to be used in conjuction with AF_LTE. Adding socket protocol NPROTO_DFU to be used in conjuction with AF_LOCAL. Adding SOL_PDN and SOL_DFU socket option levels, and associated socket option values. Signed-off-by: Glenn Ruben Bakke <[email protected]> Signed-off-by: Marti Bolivar <[email protected]> (cherry picked from commit 6a62db5) (cherry picked from commit 6702fed) Signed-off-by: Martí Bolívar <[email protected]>
1 parent fef180b commit 3e4318f

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

include/net/net_ip.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ extern "C" {
4646
#define PF_CAN 4 /**< Controller Area Network. */
4747
#define PF_NET_MGMT 5 /**< Network management info. */
4848
#define PF_LTE 102 /**< Specific to LTE. */
49+
#define PF_LOCAL 103 /**< Local to host. */
4950

5051
/* Address families. */
5152
#define AF_UNSPEC PF_UNSPEC /**< Unspecified address family. */
@@ -55,6 +56,7 @@ extern "C" {
5556
#define AF_CAN PF_CAN /**< Controller Area Network. */
5657
#define AF_NET_MGMT PF_NET_MGMT /**< Network management info. */
5758
#define AF_LTE PF_LTE /**< Specific to LTE. */
59+
#define AF_LOCAL PF_LOCAL /**< Local to host. */
5860

5961
/** Protocol numbers from IANA/BSD */
6062
enum net_ip_protocol {
@@ -79,13 +81,20 @@ enum net_ip_protocol_secure {
7981
/* Protocol numbers for LTE protocols */
8082
enum net_lte_protocol {
8183
NPROTO_AT = 513,
84+
NPROTO_PDN = 514
85+
};
86+
87+
/* Protocol numbers for LOCAL protocols */
88+
enum net_local_protocol {
89+
NPROTO_DFU = 515
8290
};
8391

8492
/** Socket type */
8593
enum net_sock_type {
86-
SOCK_STREAM = 1, /**< Stream socket type */
87-
SOCK_DGRAM, /**< Datagram socket type */
88-
SOCK_RAW /**< RAW socket type */
94+
SOCK_STREAM = 1, /**< Stream socket type */
95+
SOCK_DGRAM, /**< Datagram socket type */
96+
SOCK_RAW, /**< RAW socket type */
97+
SOCK_MGMT /**< Management socket type */
8998
};
9099

91100
/** @brief Convert 16-bit value from network to host byte order.

include/net/socket.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,24 @@ struct ifreq {
789789
char ifr_name[IFNAMSIZ]; /* Interface name */
790790
};
791791

792+
/* Protocol level for PDN. */
793+
#define SOL_PDN 514
794+
795+
/* Socket options for SOL_PDN level */
796+
#define SO_PDN_AF 1
797+
798+
/* Protocol level for DFU. */
799+
#define SOL_DFU 515
800+
801+
/* Socket options for SOL_DFU level */
802+
#define SO_DFU_FW_VERSION 1
803+
#define SO_DFU_RESOURCE 2
804+
#define SO_DFU_TIMEO 3
805+
#define SO_DFU_APPLY 4
806+
#define SO_DFU_REVERT 5
807+
#define SO_DFU_BACKUP_DELETE 6
808+
#define SO_DFU_OFFSET 7
809+
792810
/** @cond INTERNAL_HIDDEN */
793811
/**
794812
* @brief Registration information for a given BSD socket family.

0 commit comments

Comments
 (0)