Skip to content

Commit 483d921

Browse files
IPCore deprecated string-based API removal
String-based functions should be replaced with an explicit DNS hostname resolution and a SocketAddress-based API.
1 parent 24c6c4c commit 483d921

30 files changed

+2
-442
lines changed

UNITTESTS/features/netsocket/EthernetInterface/test_EthernetInterface.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,8 @@ class EmacNetworkStackMock : public OnboardNetworkStack {
9494
MOCK_CONST_METHOD0(get_connection_status, nsapi_connection_status_t());
9595
MOCK_METHOD2(get_mac_address, char *(char *buf, nsapi_size_t buflen));
9696
MOCK_METHOD1(get_ip_address, nsapi_error_t(SocketAddress *address));
97-
MOCK_METHOD2(get_ip_address, char *(char *buf, nsapi_size_t buflen));
9897
MOCK_METHOD1(get_netmask, nsapi_error_t(SocketAddress *address));
99-
MOCK_METHOD2(get_netmask, char *(char *buf, nsapi_size_t buflen));
10098
MOCK_METHOD1(get_gateway, nsapi_error_t(SocketAddress *address));
101-
MOCK_METHOD2(get_gateway, char *(char *buf, nsapi_size_t buflen));
10299
MOCK_METHOD1(get_ipv6_link_local_address, nsapi_error_t(SocketAddress *address));
103100
};
104101
};

UNITTESTS/stubs/AT_CellularContext_stub.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ nsapi_error_t AT_CellularContext::get_ip_address(SocketAddress *address)
116116
return NSAPI_ERROR_UNSUPPORTED;
117117
}
118118

119-
const char *AT_CellularContext::get_ip_address()
120-
{
121-
return NULL;
122-
}
123-
124119
void AT_CellularContext::attach(Callback<void(nsapi_event_t, intptr_t)> status_cb)
125120
{
126121
}
@@ -154,21 +149,11 @@ nsapi_error_t AT_CellularContext::get_netmask(SocketAddress *address)
154149
return NSAPI_ERROR_UNSUPPORTED;
155150
}
156151

157-
const char *AT_CellularContext::get_netmask()
158-
{
159-
return NULL;
160-
}
161-
162152
nsapi_error_t AT_CellularContext::get_gateway(SocketAddress *address)
163153
{
164154
return NSAPI_ERROR_UNSUPPORTED;
165155
}
166156

167-
const char *AT_CellularContext::get_gateway()
168-
{
169-
return NULL;
170-
}
171-
172157
AT_CellularBase::CellularProperty AT_CellularContext::pdp_type_t_to_cellular_property(pdp_type_t pdp_type)
173158
{
174159
AT_CellularBase::CellularProperty prop = PROPERTY_IPV4_PDP_TYPE;

UNITTESTS/stubs/NetworkInterface_stub.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ nsapi_error_t NetworkInterface::get_ip_address(SocketAddress *)
3131
return NSAPI_ERROR_UNSUPPORTED;
3232
}
3333

34-
const char *NetworkInterface::get_ip_address()
35-
{
36-
return nullptr;
37-
}
3834
nsapi_error_t NetworkInterface::get_ipv6_link_local_address(SocketAddress *address)
3935
{
4036
return NSAPI_ERROR_UNSUPPORTED;
@@ -45,31 +41,16 @@ nsapi_error_t NetworkInterface::get_netmask(SocketAddress *)
4541
return NSAPI_ERROR_UNSUPPORTED;
4642
}
4743

48-
const char *NetworkInterface::get_netmask()
49-
{
50-
return nullptr;
51-
}
52-
5344
nsapi_error_t NetworkInterface::get_gateway(SocketAddress *)
5445
{
5546
return NSAPI_ERROR_UNSUPPORTED;
5647
}
5748

58-
const char *NetworkInterface::get_gateway()
59-
{
60-
return nullptr;
61-
}
62-
6349
nsapi_error_t NetworkInterface::set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway)
6450
{
6551
return NSAPI_ERROR_UNSUPPORTED;
6652
}
6753

68-
nsapi_error_t NetworkInterface::set_network(const char *ip_address, const char *netmask, const char *gateway)
69-
{
70-
return NSAPI_ERROR_UNSUPPORTED;
71-
}
72-
7354
nsapi_error_t NetworkInterface::set_dhcp(bool dhcp)
7455
{
7556
return NSAPI_ERROR_UNSUPPORTED;

UNITTESTS/stubs/NetworkStack_stub.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,6 @@ nsapi_error_t NetworkStack::get_ip_address(SocketAddress* address)
9494
return NSAPI_ERROR_UNSUPPORTED;
9595
}
9696

97-
const char *NetworkStack::get_ip_address()
98-
{
99-
return NULL;
100-
}
101-
10297
nsapi_error_t NetworkStack::get_ipv6_link_local_address(SocketAddress *address)
10398
{
10499
return NSAPI_ERROR_UNSUPPORTED;
@@ -108,8 +103,3 @@ nsapi_error_t NetworkStack::get_ip_address_if(SocketAddress* address, const char
108103
{
109104
return NSAPI_ERROR_UNSUPPORTED;
110105
}
111-
112-
const char *NetworkStack::get_ip_address_if(const char *interface_name)
113-
{
114-
return NULL;
115-
}

UNITTESTS/stubs/NetworkStack_stub.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class NetworkStackstub : public NetworkStack {
3333
{
3434
}
3535

36-
virtual const char *get_ip_address()
37-
{
38-
return "127.0.0.1";
39-
}
4036
virtual nsapi_error_t get_ip_address(SocketAddress* address)
4137
{
4238
address->set_ip_address("127.0.0.1");

features/cellular/framework/API/CellularContext.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ class CellularContext : public CellularInterface {
122122
virtual nsapi_error_t set_blocking(bool blocking) = 0;
123123
virtual NetworkStack *get_stack() = 0;
124124
virtual nsapi_error_t get_ip_address(SocketAddress *address) = 0;
125-
MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated")
126-
virtual const char *get_ip_address() = 0;
127125

128126
/** Register callback for status reporting.
129127
*
@@ -147,11 +145,7 @@ class CellularContext : public CellularInterface {
147145
const char *pwd = 0) = 0;
148146
virtual void set_credentials(const char *apn, const char *uname = 0, const char *pwd = 0) = 0;
149147
virtual nsapi_error_t get_netmask(SocketAddress *address) = 0;
150-
MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated")
151-
virtual const char *get_netmask() = 0;
152148
virtual nsapi_error_t get_gateway(SocketAddress *address) = 0;
153-
MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated")
154-
virtual const char *get_gateway() = 0;
155149
virtual bool is_connected() = 0;
156150

157151
/** Same as NetworkInterface::get_default_instance()

features/cellular/framework/AT/AT_CellularContext.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,11 @@ nsapi_error_t AT_CellularContext::get_netmask(SocketAddress *address)
219219
return NSAPI_ERROR_UNSUPPORTED;
220220
}
221221

222-
const char *AT_CellularContext::get_netmask()
223-
{
224-
return NULL;
225-
}
226-
227222
nsapi_error_t AT_CellularContext::get_gateway(SocketAddress *address)
228223
{
229224
return NSAPI_ERROR_UNSUPPORTED;
230225
}
231226

232-
const char *AT_CellularContext::get_gateway()
233-
{
234-
return NULL;
235-
}
236-
237227
nsapi_error_t AT_CellularContext::get_ip_address(SocketAddress *address)
238228
{
239229
if (!address) {
@@ -254,21 +244,6 @@ nsapi_error_t AT_CellularContext::get_ip_address(SocketAddress *address)
254244
#endif
255245
}
256246

257-
const char *AT_CellularContext::get_ip_address()
258-
{
259-
#if NSAPI_PPP_AVAILABLE
260-
return nsapi_ppp_get_ip_addr(_at.get_file_handle());
261-
#else
262-
if (!_stack) {
263-
_stack = get_stack();
264-
}
265-
if (_stack) {
266-
return _stack->get_ip_address();
267-
}
268-
return NULL;
269-
#endif
270-
}
271-
272247
char *AT_CellularContext::get_interface_name(char *interface_name)
273248
{
274249
if (_cid < 0) {

features/cellular/framework/AT/AT_CellularContext.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class AT_CellularContext : public CellularContext, public AT_CellularBase {
3636
virtual nsapi_error_t set_blocking(bool blocking);
3737
virtual NetworkStack *get_stack();
3838
virtual nsapi_error_t get_ip_address(SocketAddress *address);
39-
virtual const char *get_ip_address();
4039
virtual char *get_interface_name(char *interface_name);
4140
virtual void attach(mbed::Callback<void(nsapi_event_t, intptr_t)> status_cb);
4241
virtual nsapi_error_t connect();
@@ -50,9 +49,7 @@ class AT_CellularContext : public CellularContext, public AT_CellularBase {
5049
const char *pwd = 0);
5150
virtual void set_credentials(const char *apn, const char *uname = 0, const char *pwd = 0);
5251
virtual nsapi_error_t get_netmask(SocketAddress *address);
53-
virtual const char *get_netmask();
5452
virtual nsapi_error_t get_gateway(SocketAddress *address);
55-
virtual const char *get_gateway();
5653

5754
// from CellularContext
5855
virtual nsapi_error_t get_pdpcontext_params(pdpContextList_t &params_list);

features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ void UBLOX_AT_CellularContext::get_next_credentials(char **config)
299299
}
300300
}
301301

302-
const char *UBLOX_AT_CellularContext::get_gateway()
302+
nsapi_error_t UBLOX_AT_CellularContext::get_gateway(SocketAddress *addr)
303303
{
304-
return get_ip_address();
304+
return get_ip_address(addr);
305305
}
306306

307307
nsapi_error_t UBLOX_AT_CellularContext::get_gateway(SocketAddress *addr)

features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class UBLOX_AT_CellularContext: public AT_CellularContext {
2828
virtual ~UBLOX_AT_CellularContext();
2929

3030
virtual void do_connect();
31-
virtual const char *get_gateway();
3231
virtual nsapi_error_t get_gateway(SocketAddress *addr);
3332

3433
const char *get_apn(void);

0 commit comments

Comments
 (0)