net: Fix indentation issues
Some earlier search/replace broke indentation. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
ddef35c1da
commit
b6a5d51baf
22 changed files with 131 additions and 130 deletions
|
@ -69,7 +69,8 @@ struct ieee802154_radio_api {
|
|||
/**
|
||||
* @brief Radio driver sending function that hw drivers should use
|
||||
*
|
||||
* @details This function should be used to fill in struct net_if's send pointer.
|
||||
* @details This function should be used to fill in struct net_if's send
|
||||
* pointer.
|
||||
*
|
||||
* @param iface A valid pointer on a network interface to send from
|
||||
* @param pkt A valid pointer on a packet to send
|
||||
|
|
|
@ -347,7 +347,7 @@ static inline enum net_verdict net_if_recv_data(struct net_if *iface,
|
|||
* @return Return the link layer header size
|
||||
*/
|
||||
static inline u16_t net_if_get_ll_reserve(struct net_if *iface,
|
||||
const struct in6_addr *dst_ip6)
|
||||
const struct in6_addr *dst_ip6)
|
||||
{
|
||||
return iface->l2->reserve(iface, (void *)dst_ip6);
|
||||
}
|
||||
|
|
|
@ -64,8 +64,8 @@ enum net_sock_type {
|
|||
struct in6_addr {
|
||||
union {
|
||||
u8_t u6_addr8[16];
|
||||
u16_t u6_addr16[8]; /* In big endian */
|
||||
u32_t u6_addr32[4]; /* In big endian */
|
||||
u16_t u6_addr16[8]; /* In big endian */
|
||||
u32_t u6_addr32[4]; /* In big endian */
|
||||
} in6_u;
|
||||
#define s6_addr in6_u.u6_addr8
|
||||
#define s6_addr16 in6_u.u6_addr16
|
||||
|
@ -76,8 +76,8 @@ struct in6_addr {
|
|||
struct in_addr {
|
||||
union {
|
||||
u8_t u4_addr8[4];
|
||||
u16_t u4_addr16[2]; /* In big endian */
|
||||
u32_t u4_addr32[1]; /* In big endian */
|
||||
u16_t u4_addr16[2]; /* In big endian */
|
||||
u32_t u4_addr32[1]; /* In big endian */
|
||||
} in4_u;
|
||||
#define s4_addr in4_u.u4_addr8
|
||||
#define s4_addr16 in4_u.u4_addr16
|
||||
|
@ -95,27 +95,27 @@ typedef size_t socklen_t;
|
|||
*/
|
||||
struct sockaddr_in6 {
|
||||
sa_family_t sin6_family; /* AF_INET6 */
|
||||
u16_t sin6_port; /* Port number */
|
||||
u16_t sin6_port; /* Port number */
|
||||
struct in6_addr sin6_addr; /* IPv6 address */
|
||||
u8_t sin6_scope_id; /* interfaces for a scope */
|
||||
};
|
||||
|
||||
struct sockaddr_in6_ptr {
|
||||
sa_family_t sin6_family; /* AF_INET6 */
|
||||
u16_t sin6_port; /* Port number */
|
||||
u16_t sin6_port; /* Port number */
|
||||
struct in6_addr *sin6_addr; /* IPv6 address */
|
||||
u8_t sin6_scope_id; /* interfaces for a scope */
|
||||
};
|
||||
|
||||
struct sockaddr_in {
|
||||
sa_family_t sin_family; /* AF_INET */
|
||||
u16_t sin_port; /* Port number */
|
||||
u16_t sin_port; /* Port number */
|
||||
struct in_addr sin_addr; /* IPv4 address */
|
||||
};
|
||||
|
||||
struct sockaddr_in_ptr {
|
||||
sa_family_t sin_family; /* AF_INET */
|
||||
u16_t sin_port; /* Port number */
|
||||
u16_t sin_port; /* Port number */
|
||||
struct in_addr *sin_addr; /* IPv4 address */
|
||||
};
|
||||
|
||||
|
@ -351,8 +351,8 @@ static inline bool net_is_my_ipv6_addr(struct in6_addr *addr)
|
|||
return net_if_ipv6_addr_lookup(addr, NULL) != NULL;
|
||||
}
|
||||
|
||||
extern struct net_if_mcast_addr *net_if_ipv6_maddr_lookup(const struct in6_addr *addr,
|
||||
struct net_if **iface);
|
||||
extern struct net_if_mcast_addr *net_if_ipv6_maddr_lookup(
|
||||
const struct in6_addr *addr, struct net_if **iface);
|
||||
|
||||
/**
|
||||
* @brief Check if IPv6 multicast address is found in one of the
|
||||
|
|
|
@ -126,10 +126,10 @@ struct net_offload {
|
|||
* @return 0 if ok, < 0 if error
|
||||
*/
|
||||
static inline int net_offload_get(struct net_if *iface,
|
||||
sa_family_t family,
|
||||
enum net_sock_type type,
|
||||
enum net_ip_protocol ip_proto,
|
||||
struct net_context **context)
|
||||
sa_family_t family,
|
||||
enum net_sock_type type,
|
||||
enum net_ip_protocol ip_proto,
|
||||
struct net_context **context)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
|
@ -152,9 +152,9 @@ static inline int net_offload_get(struct net_if *iface,
|
|||
* @return 0 if ok, < 0 if error
|
||||
*/
|
||||
static inline int net_offload_bind(struct net_if *iface,
|
||||
struct net_context *context,
|
||||
const struct sockaddr *addr,
|
||||
socklen_t addrlen)
|
||||
struct net_context *context,
|
||||
const struct sockaddr *addr,
|
||||
socklen_t addrlen)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
|
@ -176,8 +176,8 @@ static inline int net_offload_bind(struct net_if *iface,
|
|||
* @return 0 if ok, < 0 if error
|
||||
*/
|
||||
static inline int net_offload_listen(struct net_if *iface,
|
||||
struct net_context *context,
|
||||
int backlog)
|
||||
struct net_context *context,
|
||||
int backlog)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
|
@ -216,19 +216,19 @@ static inline int net_offload_listen(struct net_if *iface,
|
|||
* @return -ENOTSUP if the operation is not supported or implemented.
|
||||
*/
|
||||
static inline int net_offload_connect(struct net_if *iface,
|
||||
struct net_context *context,
|
||||
const struct sockaddr *addr,
|
||||
socklen_t addrlen,
|
||||
net_context_connect_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *user_data)
|
||||
struct net_context *context,
|
||||
const struct sockaddr *addr,
|
||||
socklen_t addrlen,
|
||||
net_context_connect_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *user_data)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
NET_ASSERT(iface->offload->connect);
|
||||
|
||||
return iface->offload->connect(context, addr, addrlen, cb,
|
||||
timeout, user_data);
|
||||
timeout, user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -259,10 +259,10 @@ static inline int net_offload_connect(struct net_if *iface,
|
|||
* @return 0 if ok, < 0 if error
|
||||
*/
|
||||
static inline int net_offload_accept(struct net_if *iface,
|
||||
struct net_context *context,
|
||||
net_tcp_accept_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *user_data)
|
||||
struct net_context *context,
|
||||
net_tcp_accept_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *user_data)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
|
@ -299,11 +299,11 @@ static inline int net_offload_accept(struct net_if *iface,
|
|||
* @return 0 if ok, < 0 if error
|
||||
*/
|
||||
static inline int net_offload_send(struct net_if *iface,
|
||||
struct net_pkt *pkt,
|
||||
net_context_send_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *token,
|
||||
void *user_data)
|
||||
struct net_pkt *pkt,
|
||||
net_context_send_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *token,
|
||||
void *user_data)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
|
@ -342,20 +342,20 @@ static inline int net_offload_send(struct net_if *iface,
|
|||
* @return 0 if ok, < 0 if error
|
||||
*/
|
||||
static inline int net_offload_sendto(struct net_if *iface,
|
||||
struct net_pkt *pkt,
|
||||
const struct sockaddr *dst_addr,
|
||||
socklen_t addrlen,
|
||||
net_context_send_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *token,
|
||||
void *user_data)
|
||||
struct net_pkt *pkt,
|
||||
const struct sockaddr *dst_addr,
|
||||
socklen_t addrlen,
|
||||
net_context_send_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *token,
|
||||
void *user_data)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
NET_ASSERT(iface->offload->sendto);
|
||||
|
||||
return iface->offload->sendto(pkt, dst_addr, addrlen, cb,
|
||||
timeout, token, user_data);
|
||||
timeout, token, user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -392,10 +392,10 @@ static inline int net_offload_sendto(struct net_if *iface,
|
|||
* @return 0 if ok, < 0 if error
|
||||
*/
|
||||
static inline int net_offload_recv(struct net_if *iface,
|
||||
struct net_context *context,
|
||||
net_context_recv_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *user_data)
|
||||
struct net_context *context,
|
||||
net_context_recv_cb_t cb,
|
||||
s32_t timeout,
|
||||
void *user_data)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
|
@ -418,7 +418,7 @@ static inline int net_offload_recv(struct net_if *iface,
|
|||
* @return 0 if ok, < 0 if error
|
||||
*/
|
||||
static inline int net_offload_put(struct net_if *iface,
|
||||
struct net_context *context)
|
||||
struct net_context *context)
|
||||
{
|
||||
NET_ASSERT(iface);
|
||||
NET_ASSERT(iface->offload);
|
||||
|
|
|
@ -131,7 +131,7 @@ static inline struct net_context *net_pkt_context(struct net_pkt *pkt)
|
|||
}
|
||||
|
||||
static inline void net_pkt_set_context(struct net_pkt *pkt,
|
||||
struct net_context *ctx)
|
||||
struct net_context *ctx)
|
||||
{
|
||||
pkt->context = ctx;
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ static inline u8_t net_pkt_ieee802154_rssi(struct net_pkt *pkt)
|
|||
}
|
||||
|
||||
static inline void net_pkt_set_ieee802154_rssi(struct net_pkt *pkt,
|
||||
u8_t rssi)
|
||||
u8_t rssi)
|
||||
{
|
||||
pkt->ieee802154_rssi = rssi;
|
||||
}
|
||||
|
|
|
@ -248,8 +248,8 @@ static inline u8_t compress_tfl(struct net_ipv6_hdr *ipv6,
|
|||
|
||||
/* Helper to compress Hop limit */
|
||||
static inline u8_t compress_hoplimit(struct net_ipv6_hdr *ipv6,
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
{
|
||||
/* Hop Limit */
|
||||
switch (ipv6->hop_limit) {
|
||||
|
@ -272,7 +272,7 @@ static inline u8_t compress_hoplimit(struct net_ipv6_hdr *ipv6,
|
|||
|
||||
/* Helper to compress Next header */
|
||||
static inline u8_t compress_nh(struct net_ipv6_hdr *ipv6,
|
||||
struct net_buf *frag, u8_t offset)
|
||||
struct net_buf *frag, u8_t offset)
|
||||
{
|
||||
/* Next header */
|
||||
if (ipv6->nexthdr == IPPROTO_UDP) {
|
||||
|
@ -286,9 +286,9 @@ static inline u8_t compress_nh(struct net_ipv6_hdr *ipv6,
|
|||
|
||||
/* Helpers to compress Source Address */
|
||||
static inline u8_t compress_sa(struct net_ipv6_hdr *ipv6,
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
{
|
||||
if (net_is_ipv6_addr_unspecified(&ipv6->src)) {
|
||||
NET_DBG("SAM_00, SAC_1 unspecified src address");
|
||||
|
@ -351,10 +351,10 @@ static inline u8_t compress_sa(struct net_ipv6_hdr *ipv6,
|
|||
|
||||
#if defined(CONFIG_NET_6LO_CONTEXT)
|
||||
static inline u8_t compress_sa_ctx(struct net_ipv6_hdr *ipv6,
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset,
|
||||
struct net_6lo_context *src)
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset,
|
||||
struct net_6lo_context *src)
|
||||
{
|
||||
if (!src) {
|
||||
return compress_sa(ipv6, pkt, frag, offset);
|
||||
|
@ -392,9 +392,9 @@ static inline u8_t compress_sa_ctx(struct net_ipv6_hdr *ipv6,
|
|||
|
||||
/* Helpers to compress Destination Address */
|
||||
static inline u8_t compress_da_mcast(struct net_ipv6_hdr *ipv6,
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
{
|
||||
IPHC[1] |= NET_6LO_IPHC_M_1;
|
||||
|
||||
|
@ -443,9 +443,9 @@ static inline u8_t compress_da_mcast(struct net_ipv6_hdr *ipv6,
|
|||
}
|
||||
|
||||
static inline u8_t compress_da(struct net_ipv6_hdr *ipv6,
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
{
|
||||
/* If destination address is multicast */
|
||||
if (net_is_ipv6_addr_mcast(&ipv6->dst)) {
|
||||
|
@ -501,10 +501,10 @@ static inline u8_t compress_da(struct net_ipv6_hdr *ipv6,
|
|||
|
||||
#if defined(CONFIG_NET_6LO_CONTEXT)
|
||||
static inline u8_t compress_da_ctx(struct net_ipv6_hdr *ipv6,
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset,
|
||||
struct net_6lo_context *dst)
|
||||
struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset,
|
||||
struct net_6lo_context *dst)
|
||||
{
|
||||
if (!dst) {
|
||||
return compress_da(ipv6, pkt, frag, offset);
|
||||
|
@ -544,7 +544,7 @@ static inline u8_t compress_da_ctx(struct net_ipv6_hdr *ipv6,
|
|||
|
||||
/* Helper to compress Next header UDP */
|
||||
static inline u8_t compress_nh_udp(struct net_udp_hdr *udp,
|
||||
struct net_buf *frag, u8_t offset)
|
||||
struct net_buf *frag, u8_t offset)
|
||||
{
|
||||
u8_t tmp;
|
||||
|
||||
|
@ -792,8 +792,8 @@ end:
|
|||
|
||||
/* Helper to uncompress Traffic class and Flow label */
|
||||
static inline u8_t uncompress_tfl(struct net_pkt *pkt,
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
{
|
||||
u8_t tcl;
|
||||
|
||||
|
@ -844,8 +844,8 @@ static inline u8_t uncompress_tfl(struct net_pkt *pkt,
|
|||
|
||||
/* Helper to uncompress Hoplimit */
|
||||
static inline u8_t uncompress_hoplimit(struct net_pkt *pkt,
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
{
|
||||
switch (CIPHC[0] & NET_6LO_IPHC_HLIM255) {
|
||||
case NET_6LO_IPHC_HLIM:
|
||||
|
@ -867,8 +867,8 @@ static inline u8_t uncompress_hoplimit(struct net_pkt *pkt,
|
|||
|
||||
/* Helper to uncompress Source Address */
|
||||
static inline u8_t uncompress_sa(struct net_pkt *pkt,
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
{
|
||||
|
||||
NET_DBG("SAC_0");
|
||||
|
@ -912,9 +912,9 @@ static inline u8_t uncompress_sa(struct net_pkt *pkt,
|
|||
|
||||
#if defined(CONFIG_NET_6LO_CONTEXT)
|
||||
static inline u8_t uncompress_sa_ctx(struct net_pkt *pkt,
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset,
|
||||
struct net_6lo_context *ctx)
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset,
|
||||
struct net_6lo_context *ctx)
|
||||
{
|
||||
NET_DBG("SAC_1");
|
||||
|
||||
|
@ -970,8 +970,8 @@ static inline u8_t uncompress_sa_ctx(struct net_pkt *pkt,
|
|||
|
||||
/* Helpers to uncompress Destination Address */
|
||||
static inline u8_t uncompress_da_mcast(struct net_pkt *pkt,
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
{
|
||||
NET_DBG("Dst is multicast");
|
||||
|
||||
|
@ -1026,8 +1026,8 @@ static inline u8_t uncompress_da_mcast(struct net_pkt *pkt,
|
|||
|
||||
/* Helper to uncompress Destination Address */
|
||||
static inline u8_t uncompress_da(struct net_pkt *pkt,
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset)
|
||||
{
|
||||
NET_DBG("DAC_0");
|
||||
|
||||
|
@ -1074,9 +1074,9 @@ static inline u8_t uncompress_da(struct net_pkt *pkt,
|
|||
|
||||
#if defined(CONFIG_NET_6LO_CONTEXT)
|
||||
static inline u8_t uncompress_da_ctx(struct net_pkt *pkt,
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset,
|
||||
struct net_6lo_context *ctx)
|
||||
struct net_ipv6_hdr *ipv6,
|
||||
u8_t offset,
|
||||
struct net_6lo_context *ctx)
|
||||
{
|
||||
NET_DBG("DAC_1");
|
||||
|
||||
|
@ -1134,8 +1134,8 @@ static inline u8_t uncompress_da_ctx(struct net_pkt *pkt,
|
|||
|
||||
/* Helper to uncompress NH UDP */
|
||||
static inline u8_t uncompress_nh_udp(struct net_pkt *pkt,
|
||||
struct net_udp_hdr *udp,
|
||||
u8_t offset)
|
||||
struct net_udp_hdr *udp,
|
||||
u8_t offset)
|
||||
{
|
||||
/* Port uncompression
|
||||
* 00: All 16 bits for src and dst are inlined
|
||||
|
|
|
@ -206,9 +206,9 @@ static s32_t check_hash(enum net_ip_protocol proto,
|
|||
}
|
||||
|
||||
static inline s32_t get_conn(enum net_ip_protocol proto,
|
||||
sa_family_t family,
|
||||
struct net_pkt *pkt,
|
||||
u32_t *cache_value)
|
||||
sa_family_t family,
|
||||
struct net_pkt *pkt,
|
||||
u32_t *cache_value)
|
||||
{
|
||||
struct net_udp_hdr hdr, *udp_hdr;
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ int net_icmpv4_send_echo_request(struct net_if *iface,
|
|||
*/
|
||||
pkt = net_pkt_get_reserve_tx(net_if_get_ll_reserve(iface,
|
||||
(const struct in6_addr *)dst),
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
|
||||
frag = net_pkt_get_frag(pkt, K_FOREVER);
|
||||
|
||||
|
|
|
@ -634,7 +634,7 @@ int net_icmpv6_send_echo_request(struct net_if *iface,
|
|||
src = net_if_ipv6_select_src_addr(iface, dst);
|
||||
|
||||
pkt = net_pkt_get_reserve_tx(net_if_get_ll_reserve(iface, dst),
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
|
||||
pkt = net_ipv6_create_raw(pkt, src, dst, iface, IPPROTO_ICMPV6);
|
||||
|
||||
|
|
|
@ -1780,7 +1780,7 @@ int net_ipv6_send_ns(struct net_if *iface,
|
|||
u8_t llao_len;
|
||||
|
||||
pkt = net_pkt_get_reserve_tx(net_if_get_ll_reserve(iface, dst),
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
|
||||
NET_ASSERT_INFO(pkt, "Out of TX packets");
|
||||
|
||||
|
@ -1915,7 +1915,7 @@ int net_ipv6_send_rs(struct net_if *iface)
|
|||
u8_t llao_len = 0;
|
||||
|
||||
pkt = net_pkt_get_reserve_tx(net_if_get_ll_reserve(iface, NULL),
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
|
||||
frag = net_pkt_get_frag(pkt, K_FOREVER);
|
||||
|
||||
|
@ -2572,7 +2572,7 @@ static int send_mldv2(struct net_if *iface, const struct in6_addr *addr,
|
|||
int ret;
|
||||
|
||||
pkt = net_pkt_get_reserve_tx(net_if_get_ll_reserve(iface, NULL),
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
|
||||
net_pkt_append_be16(pkt, 1); /* number of records */
|
||||
|
||||
|
@ -2640,7 +2640,7 @@ static void send_mld_report(struct net_if *iface)
|
|||
int i, count = 0;
|
||||
|
||||
pkt = net_pkt_get_reserve_tx(net_if_get_ll_reserve(iface, NULL),
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
|
||||
net_pkt_append_u8(pkt, 0); /* This will be the record count */
|
||||
|
||||
|
|
|
@ -322,4 +322,4 @@ static inline int ethernet_enable(struct net_if *iface, bool state)
|
|||
}
|
||||
|
||||
NET_L2_INIT(ETHERNET_L2, ethernet_recv, ethernet_send, ethernet_reserve,
|
||||
ethernet_enable);
|
||||
ethernet_enable);
|
||||
|
|
|
@ -136,8 +136,8 @@ static inline void set_up_frag_hdr(struct net_buf *frag, u16_t size,
|
|||
}
|
||||
|
||||
static inline u8_t calc_max_payload(struct net_pkt *pkt,
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
struct net_buf *frag,
|
||||
u8_t offset)
|
||||
{
|
||||
u8_t max;
|
||||
|
||||
|
@ -148,11 +148,11 @@ static inline u8_t calc_max_payload(struct net_pkt *pkt,
|
|||
}
|
||||
|
||||
static inline u8_t move_frag_data(struct net_buf *frag,
|
||||
struct net_buf *next,
|
||||
u8_t max,
|
||||
bool first,
|
||||
int hdr_diff,
|
||||
u8_t *room_left)
|
||||
struct net_buf *next,
|
||||
u8_t max,
|
||||
bool first,
|
||||
int hdr_diff,
|
||||
u8_t *room_left)
|
||||
{
|
||||
u8_t room;
|
||||
u8_t move;
|
||||
|
|
|
@ -410,7 +410,7 @@ bool ieee802154_validate_frame(u8_t *buf, u8_t length,
|
|||
}
|
||||
|
||||
u16_t ieee802154_compute_header_size(struct net_if *iface,
|
||||
struct in6_addr *dst)
|
||||
struct in6_addr *dst)
|
||||
{
|
||||
u16_t hdr_len = sizeof(struct ieee802154_fcf_seq);
|
||||
#ifdef CONFIG_NET_L2_IEEE802154_SECURITY
|
||||
|
@ -571,9 +571,9 @@ bool data_addr_to_fs_settings(struct net_linkaddr *dst,
|
|||
|
||||
static
|
||||
u8_t *generate_addressing_fields(struct ieee802154_context *ctx,
|
||||
struct ieee802154_fcf_seq *fs,
|
||||
struct ieee802154_frame_params *params,
|
||||
u8_t *p_buf)
|
||||
struct ieee802154_fcf_seq *fs,
|
||||
struct ieee802154_frame_params *params,
|
||||
u8_t *p_buf)
|
||||
{
|
||||
struct ieee802154_address_field *af;
|
||||
struct ieee802154_address *src_addr;
|
||||
|
@ -625,7 +625,7 @@ u8_t *generate_addressing_fields(struct ieee802154_context *ctx,
|
|||
#ifdef CONFIG_NET_L2_IEEE802154_SECURITY
|
||||
static
|
||||
u8_t *generate_aux_security_hdr(struct ieee802154_security_ctx *sec_ctx,
|
||||
u8_t *p_buf)
|
||||
u8_t *p_buf)
|
||||
{
|
||||
struct ieee802154_aux_security_hdr *aux_sec;
|
||||
|
||||
|
|
|
@ -457,7 +457,7 @@ bool ieee802154_validate_frame(u8_t *buf, u8_t length,
|
|||
struct ieee802154_mpdu *mpdu);
|
||||
|
||||
u16_t ieee802154_compute_header_size(struct net_if *iface,
|
||||
struct in6_addr *dst);
|
||||
struct in6_addr *dst);
|
||||
|
||||
bool ieee802154_create_data_frame(struct ieee802154_context *ctx,
|
||||
struct net_linkaddr *dst,
|
||||
|
|
|
@ -78,8 +78,8 @@ static struct net_context contexts[NET_MAX_CONTEXT];
|
|||
static struct k_sem contexts_lock;
|
||||
|
||||
static enum net_verdict packet_received(struct net_conn *conn,
|
||||
struct net_pkt *pkt,
|
||||
void *user_data);
|
||||
struct net_pkt *pkt,
|
||||
void *user_data);
|
||||
|
||||
static void set_appdata_values(struct net_pkt *pkt, enum net_ip_protocol proto);
|
||||
|
||||
|
|
|
@ -1128,8 +1128,8 @@ bool net_pkt_compact(struct net_pkt *pkt)
|
|||
* the buffer. It assumes that the buffer has at least one fragment.
|
||||
*/
|
||||
static inline u16_t net_pkt_append_bytes(struct net_pkt *pkt,
|
||||
const u8_t *value,
|
||||
u16_t len, s32_t timeout)
|
||||
const u8_t *value,
|
||||
u16_t len, s32_t timeout)
|
||||
{
|
||||
struct net_buf *frag = net_buf_frag_last(pkt->frags);
|
||||
u16_t added_len = 0;
|
||||
|
@ -1235,7 +1235,7 @@ static inline struct net_buf *adjust_offset(struct net_buf *frag,
|
|||
}
|
||||
|
||||
struct net_buf *net_frag_read(struct net_buf *frag, u16_t offset,
|
||||
u16_t *pos, u16_t len, u8_t *data)
|
||||
u16_t *pos, u16_t len, u8_t *data)
|
||||
{
|
||||
u16_t copy = 0;
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ struct net_rpl_dag *net_rpl_of_best_dag(struct net_rpl_dag *dag1,
|
|||
ALIAS_OF(net_rpl_mrhof_best_dag);
|
||||
|
||||
static u16_t net_rpl_mrhof_calc_rank(struct net_rpl_parent *parent,
|
||||
u16_t base_rank)
|
||||
u16_t base_rank)
|
||||
{
|
||||
u16_t new_rank;
|
||||
u16_t rank_increase = 0;
|
||||
|
@ -300,7 +300,7 @@ static u16_t net_rpl_mrhof_calc_rank(struct net_rpl_parent *parent,
|
|||
}
|
||||
|
||||
u16_t net_rpl_of_calc_rank(struct net_rpl_parent *parent,
|
||||
u16_t base_rank)
|
||||
u16_t base_rank)
|
||||
ALIAS_OF(net_rpl_mrhof_calc_rank);
|
||||
|
||||
static int net_rpl_mrhof_update_mc(struct net_rpl_instance *instance)
|
||||
|
|
|
@ -200,7 +200,7 @@ struct net_rpl_dag *net_rpl_of_best_dag(struct net_rpl_dag *dag1,
|
|||
ALIAS_OF(net_rpl_of0_best_dag);
|
||||
|
||||
static u16_t net_rpl_of0_calc_rank(struct net_rpl_parent *parent,
|
||||
u16_t base_rank)
|
||||
u16_t base_rank)
|
||||
{
|
||||
u16_t increment;
|
||||
|
||||
|
@ -226,7 +226,7 @@ static u16_t net_rpl_of0_calc_rank(struct net_rpl_parent *parent,
|
|||
}
|
||||
|
||||
u16_t net_rpl_of_calc_rank(struct net_rpl_parent *parent,
|
||||
u16_t base_rank)
|
||||
u16_t base_rank)
|
||||
ALIAS_OF(net_rpl_of0_calc_rank);
|
||||
|
||||
static int net_rpl_of0_update_mc(struct net_rpl_instance *instance)
|
||||
|
|
|
@ -193,7 +193,7 @@ void net_rpl_set_mode(enum net_rpl_mode new_mode)
|
|||
}
|
||||
|
||||
static inline u32_t net_rpl_lifetime(struct net_rpl_instance *instance,
|
||||
u8_t lifetime)
|
||||
u8_t lifetime)
|
||||
{
|
||||
return (u32_t)instance->lifetime_unit * (u32_t)lifetime;
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ int net_rpl_dio_send(struct net_if *iface,
|
|||
int ret;
|
||||
|
||||
pkt = net_pkt_get_reserve_tx(net_if_get_ll_reserve(iface, dst),
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
if (!pkt) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ int net_rpl_dio_send(struct net_if *iface,
|
|||
net_pkt_append_be16(pkt, 0);
|
||||
|
||||
net_pkt_append_all(pkt, sizeof(struct in6_addr), dag->dag_id.s6_addr,
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
|
||||
if (instance->mc.type != NET_RPL_MC_NONE) {
|
||||
net_rpl_of_update_mc(instance);
|
||||
|
@ -759,7 +759,7 @@ int net_rpl_dis_send(struct in6_addr *dst, struct net_if *iface)
|
|||
}
|
||||
|
||||
pkt = net_pkt_get_reserve_tx(net_if_get_ll_reserve(iface, dst_addr),
|
||||
K_FOREVER);
|
||||
K_FOREVER);
|
||||
if (!pkt) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
@ -380,7 +380,7 @@ extern struct net_rpl_dag *net_rpl_of_best_dag(struct net_rpl_dag *dagA,
|
|||
* about parent to select an increment to the base rank.
|
||||
*/
|
||||
extern u16_t net_rpl_of_calc_rank(struct net_rpl_parent *parent,
|
||||
u16_t rank);
|
||||
u16_t rank);
|
||||
|
||||
/**
|
||||
* @brief RPL object function (OF) update metric container.
|
||||
|
|
|
@ -277,7 +277,7 @@ int net_tcp_release(struct net_tcp *tcp)
|
|||
}
|
||||
|
||||
static inline u8_t net_tcp_add_options(struct net_buf *header, size_t len,
|
||||
void *data)
|
||||
void *data)
|
||||
{
|
||||
u8_t optlen;
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ static u16_t calc_chksum(u16_t sum, const u8_t *ptr, u16_t len)
|
|||
}
|
||||
|
||||
static inline u16_t calc_chksum_pkt(u16_t sum, struct net_pkt *pkt,
|
||||
u16_t upper_layer_len)
|
||||
u16_t upper_layer_len)
|
||||
{
|
||||
u16_t proto_len = net_pkt_ip_hdr_len(pkt) +
|
||||
net_pkt_ipv6_ext_len(pkt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue