Skip to content

Commit

Permalink
Merge pull request #127 from leandrolanzieri/pr/fix_riot_session
Browse files Browse the repository at this point in the history
session.h: Modify session_t for RIOT
  • Loading branch information
obgm committed May 23, 2022
2 parents 97fc374 + a45122b commit 2546738
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions session.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#elif defined(WITH_RIOT_SOCK)
#define _dtls_address_equals_impl(A,B) \
((A)->size == (B)->size \
&& (A)->port == (B)->port \
&& ipv6_addr_equal(&((A)->addr),&((B)->addr)) \
&& (A)->addr.port == (B)->addr.port \
&& ipv6_addr_equal(&((A)->addr.addr6),&((B)->addr.addr6)) \
&& (A)->ifindex == (B)->ifindex)
#else /* WITH_CONTIKI */

Expand Down
18 changes: 10 additions & 8 deletions session.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@
#ifdef WITH_CONTIKI
#include "ip/uip.h"
typedef struct {
unsigned char size;
uip_ipaddr_t addr;
unsigned short port;
int ifindex;
unsigned char size; /**< size of session_t::addr */
uip_ipaddr_t addr; /**< session IP address */
unsigned short port; /**< transport layer port */
int ifindex; /**< network interface index */
} session_t;
/* TODO: Add support for RIOT over sockets */
#elif defined(WITH_RIOT_SOCK)
#include "net/ipv6/addr.h"
typedef struct {
unsigned char size;
ipv6_addr_t addr;
unsigned short port;
int ifindex;
unsigned char size; /**< size of session_t::addr */
struct {
unsigned short port; /**< transport layer port */
ipv6_addr_t addr6; /**< IPv6 address */
} addr; /**< session IP address and port */
int ifindex; /**< network interface index */
} session_t;
#else /* ! WITH_CONTIKI && ! WITH_RIOT_SOCK */

Expand Down

0 comments on commit 2546738

Please sign in to comment.