File tree Expand file tree Collapse file tree 5 files changed +372
-71
lines changed
features/net/FEATURE_IPV4/lwip-interface Expand file tree Collapse file tree 5 files changed +372
-71
lines changed Original file line number Diff line number Diff line change @@ -59,17 +59,29 @@ const char *EthernetInterface::get_mac_address()
59
59
60
60
const char *EthernetInterface::get_ip_address ()
61
61
{
62
- return lwip_get_ip_address ();
62
+ if (lwip_get_ip_address (_ip_address, sizeof _ip_address)) {
63
+ return _ip_address;
64
+ }
65
+
66
+ return 0 ;
63
67
}
64
68
65
69
const char *EthernetInterface::get_netmask ()
66
70
{
67
- return lwip_get_netmask ();
71
+ if (lwip_get_netmask (_netmask, sizeof _netmask)) {
72
+ return _netmask;
73
+ }
74
+
75
+ return 0 ;
68
76
}
69
77
70
78
const char *EthernetInterface::get_gateway ()
71
79
{
72
- return lwip_get_gateway ();
80
+ if (lwip_get_gateway (_gateway, sizeof _gateway)) {
81
+ return _gateway;
82
+ }
83
+
84
+ return 0 ;
73
85
}
74
86
75
87
NetworkStack *EthernetInterface::get_stack ()
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ class EthernetInterface : public EthInterface
92
92
*/
93
93
virtual const char *get_netmask ();
94
94
95
- /* * Get the local gateway
95
+ /* * Get the local gateways
96
96
*
97
97
* @return Null-terminated representation of the local gateway
98
98
* or null if no network mask has been recieved
@@ -107,7 +107,7 @@ class EthernetInterface : public EthInterface
107
107
virtual NetworkStack *get_stack ();
108
108
109
109
bool _dhcp;
110
- char _ip_address[NSAPI_IPv4_SIZE ];
110
+ char _ip_address[IPADDR_STRLEN_MAX ];
111
111
char _netmask[NSAPI_IPv4_SIZE];
112
112
char _gateway[NSAPI_IPv4_SIZE];
113
113
};
You can’t perform that action at this time.
0 commit comments