Skip to content

Commit

Permalink
openstack/04-TRAN: move sock to own directory
Browse files Browse the repository at this point in the history
  • Loading branch information
fjmolinas authored and TimothyClaeys committed Feb 10, 2021
1 parent 75e8a8f commit d5eaba1
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 45 deletions.
3 changes: 2 additions & 1 deletion SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ elif env['toolchain'] == 'gcc':

if os.name != 'nt':
if env['simhost'].endswith('linux'):
# enabling shared library to be reallocated
# enabling shared library to be reallocated
env.Append(CCFLAGS='-fPIC')
if not sys.platform.startswith('darwin'): # line added per FW-230
env.Append(SHLINKFLAGS='-Wl,-Bsymbolic-functions') # per FW-176
Expand Down Expand Up @@ -1165,6 +1165,7 @@ def buildIncludePath(project_dir, local_env):
os.path.join('#', 'openstack', '03a-IPHC'),
os.path.join('#', 'openstack', '03b-IPv6'),
os.path.join('#', 'openstack', '04-TRAN'),
os.path.join('#', 'openstack', '04-TRAN', 'sock'),
os.path.join('#', 'openstack', 'cross-layers'),
os.path.join('#', 'drivers', 'common'),
]
Expand Down
11 changes: 6 additions & 5 deletions drivers/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ sources_h = [
]

if localEnv['board']=='python':

for s in sources_c+sources_h:
temp = localEnv.Objectify(
target = localEnv.ObjectifiedFilename(s),
source = s,
)
#localEnv.AlwaysBuild(temp)

libdrivers = localEnv.Library(
target = target,
source = [localEnv.ObjectifiedFilename(s) for s in sources_c],
)
localEnv.Depends(libdrivers,[localEnv.ObjectifiedFilename(s) for s in sources_h])

else:

localEnv.Append(
CPPPATH = [
os.path.join('#','drivers','common'),
Expand All @@ -57,13 +57,14 @@ else:
os.path.join('#','openstack','03a-IPHC'),
os.path.join('#','openstack','03b-IPv6'),
os.path.join('#','openstack','04-TRAN'),
os.path.join('#','openstack','04-TRAN', 'sock'),
os.path.join('#','openstack','cross-layers'),
],
)

libdrivers = localEnv.Library(
target = target,
source = sources_c,
)

Alias('libdrivers', libdrivers)
7 changes: 4 additions & 3 deletions openapps/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sources_h += [os.path.join("cjoin", "cojp_cbor.h")]
#===== build the openapps library

if localEnv['board']=='python':

for s in sources_c+sources_h:
temp = localEnv.Objectify(
target = localEnv.ObjectifiedFilename(s),
Expand All @@ -51,9 +51,9 @@ if localEnv['board']=='python':
source = [localEnv.ObjectifiedFilename(s) for s in sources_c],
)
localEnv.Depends(libopenapps, [localEnv.ObjectifiedFilename(s) for s in sources_h])

else:

localEnv.Append(
CPPPATH = [
# inc
Expand All @@ -66,6 +66,7 @@ else:
os.path.join('#', 'openstack', '03a-IPHC'),
os.path.join('#', 'openstack', '03b-IPv6'),
os.path.join('#', 'openstack', '04-TRAN'),
os.path.join('#', 'openstack', '04-TRAN', 'sock'),
os.path.join('#', 'openstack', 'cross-layers'),
# openapps
os.path.join('#', 'openweb', 'opencoap'),
Expand Down
23 changes: 0 additions & 23 deletions openstack/04-TRAN/async.h

This file was deleted.

9 changes: 9 additions & 0 deletions openstack/04-TRAN/sock/async.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef OPENWSN_ASYNC_SOCKET_H
#define OPENWSN_ASYNC_SOCKET_H

#include "sock.h"


void sock_udp_set_cb(sock_udp_t* sock, sock_udp_cb_t cb, void* cb_arg);

#endif /* OPENWSN_ASYNC_SOCKET_H */
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ typedef enum {

typedef struct sock_udp sock_udp_t; /**< forward declare for async */

// definitions asynchronous callback for socket events
/**
* @brief Event callback for @ref sock_udp_t
*
* @pre `(sock != NULL)`
*
* @param[in] sock The sock the event happened on
* @param[in] flags The event flags. Expected values are
* - @ref SOCK_ASYNC_MSG_RECV,
* - @ref SOCK_ASYNC_MSG_SENT,
* - @ref SOCK_ASYNC_PATH_PROP, or
* - a combination of them.
* @param[in] arg Argument provided when setting the callback using
* @ref sock_udp_set_cb(). May be NULL.
*/
typedef void (* sock_udp_cb_t)(sock_udp_t* sock, sock_async_flags_t type, void* arg);

#endif /* OPENWSN_ASYNC_TYPES_H */
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 11 additions & 10 deletions openstack/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sources_c = [
os.path.join('03b-IPv6','icmpv6rpl.c'),
#=== 04-TRAN
os.path.join('04-TRAN','udp.c'),
os.path.join('04-TRAN','sock.c'),
os.path.join('04-TRAN','sock','sock.c'),
#=== cross-layers
os.path.join('cross-layers','idmanager.c'),
os.path.join('cross-layers','openqueue.c'),
Expand Down Expand Up @@ -60,11 +60,11 @@ sources_h = [
os.path.join('03b-IPv6','icmpv6rpl.h'),
#=== 04-TRAN
os.path.join('04-TRAN','udp.h'),
os.path.join('04-TRAN','sock.h'),
os.path.join('04-TRAN','async.h'),
os.path.join('04-TRAN','sock_types.h'),
os.path.join('04-TRAN','sock_internal.h'),
os.path.join('04-TRAN','async_types.h'),
os.path.join('04-TRAN','sock', 'sock_internal.h'),
os.path.join('04-TRAN','sock','sock.h'),
os.path.join('04-TRAN','sock','async.h'),
os.path.join('04-TRAN','sock','sock_types.h'),
os.path.join('04-TRAN','sock','async_types.h'),
#=== cross-layers
os.path.join('cross-layers','idmanager.h'),
os.path.join('cross-layers','openqueue.h'),
Expand All @@ -73,7 +73,7 @@ sources_h = [
]

if localEnv['board']=='python':

for s in sources_c+sources_h:
temp = localEnv.Objectify(
target = localEnv.ObjectifiedFilename(s),
Expand All @@ -85,9 +85,9 @@ if localEnv['board']=='python':
source = [localEnv.ObjectifiedFilename(s) for s in sources_c],
)
localEnv.Depends(libopenstack,[localEnv.ObjectifiedFilename(s) for s in sources_h])

else:

localEnv.Append(
CPPPATH = [
# inc
Expand All @@ -105,14 +105,15 @@ else:
os.path.join('#','openstack','03a-IPHC'),
os.path.join('#','openstack','03b-IPv6'),
os.path.join('#','openstack','04-TRAN'),
os.path.join('#','openstack','04-TRAN','sock'),
os.path.join('#','openstack','cross-layers'),
# openweb
os.path.join('#','openweb'),
# openapps
os.path.join('#','openapps')
],
)

libopenstack = localEnv.Library(
target = target,
source = sources_c,
Expand Down
1 change: 1 addition & 0 deletions openweb/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ else:
os.path.join('#','openstack','03a-IPHC'),
os.path.join('#','openstack','03b-IPv6'),
os.path.join('#','openstack','04-TRAN'),
os.path.join('#','openstack','04-TRAN','sock'),
os.path.join('#','openstack','cross-layers'),
# openapps
os.path.join('#','openweb'),
Expand Down
5 changes: 3 additions & 2 deletions projects/python/SConscript.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ buildEnv['BSP'] = buildEnv['board']
isCrossBuild = False
if os.name != 'nt':
if platform.architecture()[0] == '64bit' and buildEnv['simhost'] == 'x86-linux':
# Search for a well-known file in the include directory tree to avoid
# Search for a well-known file in the include directory tree to avoid
# hard-coding the intervening directories, which may refer to the build host
# or Python version. For example, on the author's system, the file is in the
# 'i386-linux-gnu/python2.7' directory.
Expand Down Expand Up @@ -71,6 +71,7 @@ buildEnv.Append(
os.path.join('#', 'build', 'python_gcc', 'openstack', '03a-IPHC'),
os.path.join('#', 'build', 'python_gcc', 'openstack', '03b-IPv6'),
os.path.join('#', 'build', 'python_gcc', 'openstack', '04-TRAN'),
os.path.join('#', 'build', 'python_gcc', 'openstack', '04-TRAN','sock'),
os.path.join('#', 'build', 'python_gcc', 'openstack', 'cross-layers'),
# openweb
os.path.join('#','build','python_gcc','openweb'),
Expand Down Expand Up @@ -1062,7 +1063,7 @@ def objectify(env, target, source):
flags=re.DOTALL,
)

# comment out global variables declarations
# comment out global variables declarations
if not header_file:
for v in vars_to_change:
lines = re.sub(
Expand Down

0 comments on commit d5eaba1

Please sign in to comment.