config: Control the interface from the command line net config file.

This commit is contained in:
Chris Johns 2019-06-12 17:21:33 +10:00
parent c099dbe9f6
commit 71365506a8
3 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,4 @@
NET_CFG_INTERFACE_0 = lo0
NET_CFG_SELF_IP = 10.0.2.1 NET_CFG_SELF_IP = 10.0.2.1
NET_CFG_NETMASK = 255.255.0.0 NET_CFG_NETMASK = 255.255.0.0
NET_CFG_PEER_IP = 192.168.100.11 NET_CFG_PEER_IP = 192.168.100.11

View File

@ -53,7 +53,7 @@
#elif defined(LIBBSP_ARM_ATSAM_BSP_H) #elif defined(LIBBSP_ARM_ATSAM_BSP_H)
#define NET_CFG_INTERFACE_0 "if_atsam0" #define NET_CFG_INTERFACE_0 "if_atsam0"
#else #else
#define NET_CFG_INTERFACE_0 "lo0" #define NET_CFG_INTERFACE_0 "@NET_CFG_INTERFACE_0@"
#endif #endif
#define NET_CFG_SELF_IP "@NET_CFG_SELF_IP@" #define NET_CFG_SELF_IP "@NET_CFG_SELF_IP@"

View File

@ -218,7 +218,8 @@ class Builder(builder.ModuleManager):
# #
if not os.path.exists(bld.env.NET_CONFIG): if not os.path.exists(bld.env.NET_CONFIG):
bld.fatal('network configuraiton \'%s\' not found' % (bld.env.NET_CONFIG)) bld.fatal('network configuraiton \'%s\' not found' % (bld.env.NET_CONFIG))
tags = [ 'NET_CFG_SELF_IP', tags = [ 'NET_CFG_INTERFACE_0',
'NET_CFG_SELF_IP',
'NET_CFG_NETMASK', 'NET_CFG_NETMASK',
'NET_CFG_PEER_IP', 'NET_CFG_PEER_IP',
'NET_CFG_GATEWAY_IP' ] 'NET_CFG_GATEWAY_IP' ]