Skip to content

Commit fc71bad

Browse files
committed
Rename Interface -> Stack
NetworkInterface -> NetworkStack EthernetInterface -> EthernetStack WiFiInterface -> WiFiStack CellularInterface -> CellularStack MeshInterface -> MeshStack
1 parent d36a0b6 commit fc71bad

18 files changed

+53
-53
lines changed

CellularInterface.h renamed to CellularStack.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* CellularInterface
1+
/* CellularStack
22
* Copyright (c) 2015 ARM Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,13 +17,13 @@
1717
#ifndef CELLULAR_INTERFACE_H
1818
#define CELLULAR_INTERFACE_H
1919

20-
#include "NetworkInterface.h"
20+
#include "NetworkStack.h"
2121

22-
/** CellularInterface class
22+
/** CellularStack class
2323
*
2424
* Common interface that is shared between ethernet hardware
2525
*/
26-
class CellularInterface : public NetworkInterface
26+
class CellularStack : public NetworkStack
2727
{
2828
public:
2929
/** Start the interface

DnsQuery/DnsQuery.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static int32_t query(UDPSocket *socket, const SocketAddress &addr, const char *h
185185
return NSAPI_ERROR_DNS_FAILURE;
186186
}
187187

188-
int32_t dnsQuery(NetworkInterface *iface, const char *host, char *ip)
188+
int32_t dnsQuery(NetworkStack *iface, const char *host, char *ip)
189189
{
190190
if (isIP(host)) {
191191
strcpy(ip, host);

DnsQuery/DnsQuery.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#ifndef __DNSQUERY_H__
1919
#define __DNSQUERY_H__
2020

21-
#include "NetworkInterface.h"
21+
#include "NetworkStack.h"
2222
#include "UDPSocket.h"
2323

2424

@@ -34,7 +34,7 @@
3434
* @returns 0 on succes, NS_DNS_FAILURE if host is not found,
3535
* or a negative value for other errors.
3636
*/
37-
int32_t dnsQuery(NetworkInterface *iface, const char *host, char *ip);
37+
int32_t dnsQuery(NetworkStack *iface, const char *host, char *ip);
3838
int32_t dnsQuery(UDPSocket *sock, const char *host, char *ip);
3939

4040

EthernetInterface.h renamed to EthernetStack.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* EthernetInterface
1+
/* EthernetStack
22
* Copyright (c) 2015 ARM Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,13 +17,13 @@
1717
#ifndef ETHERNET_INTERFACE_H
1818
#define ETHERNET_INTERFACE_H
1919

20-
#include "NetworkInterface.h"
20+
#include "NetworkStack.h"
2121

22-
/** EthernetInterface class
22+
/** EthernetStack class
2323
*
2424
* Common interface that is shared between ethernet hardware.
2525
*/
26-
class EthernetInterface : public NetworkInterface
26+
class EthernetStack : public NetworkStack
2727
{
2828
public:
2929
/** Start the interface

MeshInterface.h renamed to MeshStack.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* MeshInterface
1+
/* MeshStack
22
* Copyright (c) 2015 ARM Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,13 +17,13 @@
1717
#ifndef MESH_INTERFACE_H
1818
#define MESH_INTERFACE_H
1919

20-
#include "NetworkInterface.h"
20+
#include "NetworkStack.h"
2121

22-
/** MeshInterface class
22+
/** MeshStack class
2323
*
2424
* Common interface that is shared between mesh hardware
2525
*/
26-
class MeshInterface : public NetworkInterface
26+
class MeshStack : public NetworkStack
2727
{
2828
public:
2929
/** Start the interface

NetworkInterface.cpp renamed to NetworkStack.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "DnsQuery.h"
1818
#include "mbed.h"
1919

20-
int NetworkInterface::gethostbyname(SocketAddress *address, const char *name)
20+
int NetworkStack::gethostbyname(SocketAddress *address, const char *name)
2121
{
2222
char buffer[NSAPI_IP_SIZE];
2323
int err = dnsQuery(this, name, buffer);
@@ -29,22 +29,22 @@ int NetworkInterface::gethostbyname(SocketAddress *address, const char *name)
2929
return 0;
3030
}
3131

32-
int NetworkInterface::setstackopt(int level, int optname, const void *optval, unsigned optlen)
32+
int NetworkStack::setstackopt(int level, int optname, const void *optval, unsigned optlen)
3333
{
3434
return NSAPI_ERROR_UNSUPPORTED;
3535
}
3636

37-
int NetworkInterface::getstackopt(int level, int optname, void *optval, unsigned *optlen)
37+
int NetworkStack::getstackopt(int level, int optname, void *optval, unsigned *optlen)
3838
{
3939
return NSAPI_ERROR_UNSUPPORTED;
4040
}
4141

42-
int NetworkInterface::setsockopt(void *handle, int level, int optname, const void *optval, unsigned optlen)
42+
int NetworkStack::setsockopt(void *handle, int level, int optname, const void *optval, unsigned optlen)
4343
{
4444
return NSAPI_ERROR_UNSUPPORTED;
4545
}
4646

47-
int NetworkInterface::getsockopt(void *handle, int level, int optname, void *optval, unsigned *optlen)
47+
int NetworkStack::getsockopt(void *handle, int level, int optname, void *optval, unsigned *optlen)
4848
{
4949
return NSAPI_ERROR_UNSUPPORTED;
5050
}

NetworkInterface.h renamed to NetworkStack.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* NetworkInterface
1+
/* NetworkStack
22
* Copyright (c) 2015 ARM Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -62,17 +62,17 @@ enum nsapi_protocol_t {
6262
#define NSAPI_MAC_BYTES 6
6363

6464

65-
/** NetworkInterface class
65+
/** NetworkStack class
6666
*
6767
* Common interface that is shared between hardware that
6868
* can connect to a network over IP. By implementing the
69-
* NetworkInterface, a network stack can be used as a target
69+
* NetworkStack, a network stack can be used as a target
7070
* for instantiating network sockets.
7171
*/
72-
class NetworkInterface
72+
class NetworkStack
7373
{
7474
public:
75-
virtual ~NetworkInterface() {};
75+
virtual ~NetworkStack() {};
7676

7777
/** Get the local IP address
7878
*

Socket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Socket::~Socket()
3131
}
3232
}
3333

34-
int Socket::open(NetworkInterface *iface, nsapi_protocol_t proto)
34+
int Socket::open(NetworkStack *iface, nsapi_protocol_t proto)
3535
{
3636
_iface = iface;
3737

Socket.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define SOCKET_H
1919

2020
#include "SocketAddress.h"
21-
#include "NetworkInterface.h"
21+
#include "NetworkStack.h"
2222

2323
/** Abstract socket class
2424
*/
@@ -38,7 +38,7 @@ class Socket {
3838
* @param iface Network stack as target for socket
3939
* @return 0 on success, negative error code on failure
4040
*/
41-
virtual int open(NetworkInterface *iface) = 0;
41+
virtual int open(NetworkStack *iface) = 0;
4242

4343
/** Close the socket
4444
*
@@ -160,11 +160,11 @@ class Socket {
160160

161161
protected:
162162
Socket();
163-
int open(NetworkInterface *iface, nsapi_protocol_t proto);
163+
int open(NetworkStack *iface, nsapi_protocol_t proto);
164164

165165
static void thunk(void *);
166166

167-
NetworkInterface *_iface;
167+
NetworkStack *_iface;
168168
void *_socket;
169169
bool _blocking;
170170
unsigned _timeout;

SocketAddress.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#include "SocketAddress.h"
18-
#include "NetworkInterface.h"
18+
#include "NetworkStack.h"
1919
#include <string.h>
2020
#include "mbed.h"
2121

@@ -126,7 +126,7 @@ static void ipv6_to_address(char *addr, const uint8_t *bytes)
126126
}
127127

128128

129-
SocketAddress::SocketAddress(NetworkInterface *iface, const char *host, uint16_t port)
129+
SocketAddress::SocketAddress(NetworkStack *iface, const char *host, uint16_t port)
130130
{
131131
// Check for valid IP addresses
132132
if (host && ipv4_is_valid(host)) {

0 commit comments

Comments
 (0)