Skip to content

Commit

Permalink
[nrf noup]: include: net: Align with bsdlib defines.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gbakke authored and mbolivar-nordic committed Oct 24, 2019
1 parent fef180b commit 3e4318f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
15 changes: 12 additions & 3 deletions include/net/net_ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extern "C" {
#define PF_CAN 4 /**< Controller Area Network. */
#define PF_NET_MGMT 5 /**< Network management info. */
#define PF_LTE 102 /**< Specific to LTE. */
#define PF_LOCAL 103 /**< Local to host. */

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

/** Protocol numbers from IANA/BSD */
enum net_ip_protocol {
Expand All @@ -79,13 +81,20 @@ enum net_ip_protocol_secure {
/* Protocol numbers for LTE protocols */
enum net_lte_protocol {
NPROTO_AT = 513,
NPROTO_PDN = 514
};

/* Protocol numbers for LOCAL protocols */
enum net_local_protocol {
NPROTO_DFU = 515
};

/** Socket type */
enum net_sock_type {
SOCK_STREAM = 1, /**< Stream socket type */
SOCK_DGRAM, /**< Datagram socket type */
SOCK_RAW /**< RAW socket type */
SOCK_STREAM = 1, /**< Stream socket type */
SOCK_DGRAM, /**< Datagram socket type */
SOCK_RAW, /**< RAW socket type */
SOCK_MGMT /**< Management socket type */
};

/** @brief Convert 16-bit value from network to host byte order.
Expand Down
18 changes: 18 additions & 0 deletions include/net/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,24 @@ struct ifreq {
char ifr_name[IFNAMSIZ]; /* Interface name */
};

/* Protocol level for PDN. */
#define SOL_PDN 514

/* Socket options for SOL_PDN level */
#define SO_PDN_AF 1

/* Protocol level for DFU. */
#define SOL_DFU 515

/* Socket options for SOL_DFU level */
#define SO_DFU_FW_VERSION 1
#define SO_DFU_RESOURCE 2
#define SO_DFU_TIMEO 3
#define SO_DFU_APPLY 4
#define SO_DFU_REVERT 5
#define SO_DFU_BACKUP_DELETE 6
#define SO_DFU_OFFSET 7

/** @cond INTERNAL_HIDDEN */
/**
* @brief Registration information for a given BSD socket family.
Expand Down

0 comments on commit 3e4318f

Please sign in to comment.