Wrapper of NetworkSocketAPI for BSD sockets on POSIX systems
Dependents: BSDInterfaceTests HelloBSDInterface
BSDInterface.h@2:0978e139e1c5, 2016-02-28 (annotated)
- Committer:
- Christopher Haster
- Date:
- Sun Feb 28 10:32:22 2016 -0600
- Revision:
- 2:0978e139e1c5
- Parent:
- 1:29c61c1420c8
- Child:
- 3:eabc4ea66a64
Fixed link level naming conflict with sockets
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Christopher Haster |
1:29c61c1420c8 | 1 | /* BSD implementation of NetworkInterfaceAPI |
geky | 0:d92b89886434 | 2 | * Copyright (c) 2015 ARM Limited |
geky | 0:d92b89886434 | 3 | * |
geky | 0:d92b89886434 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
geky | 0:d92b89886434 | 5 | * you may not use this file except in compliance with the License. |
geky | 0:d92b89886434 | 6 | * You may obtain a copy of the License at |
geky | 0:d92b89886434 | 7 | * |
geky | 0:d92b89886434 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
geky | 0:d92b89886434 | 9 | * |
geky | 0:d92b89886434 | 10 | * Unless required by applicable law or agreed to in writing, software |
geky | 0:d92b89886434 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
geky | 0:d92b89886434 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
geky | 0:d92b89886434 | 13 | * See the License for the specific language governing permissions and |
geky | 0:d92b89886434 | 14 | * limitations under the License. |
geky | 0:d92b89886434 | 15 | */ |
geky | 0:d92b89886434 | 16 | |
Christopher Haster |
1:29c61c1420c8 | 17 | #ifndef BSD_INTERFACE_H |
Christopher Haster |
1:29c61c1420c8 | 18 | #define BSD_INTERFACE_H |
geky | 0:d92b89886434 | 19 | |
geky | 0:d92b89886434 | 20 | #include "EthernetInterface.h" |
geky | 0:d92b89886434 | 21 | |
geky | 0:d92b89886434 | 22 | |
Christopher Haster |
1:29c61c1420c8 | 23 | /** BSDInterface class |
Christopher Haster |
1:29c61c1420c8 | 24 | * Implementation of the NetworkInterface for BSD sockets |
geky | 0:d92b89886434 | 25 | */ |
Christopher Haster |
1:29c61c1420c8 | 26 | class BSDInterface : public NetworkInterface |
geky | 0:d92b89886434 | 27 | { |
geky | 0:d92b89886434 | 28 | public: |
geky | 0:d92b89886434 | 29 | // Implementation of NetworkInterface |
geky | 0:d92b89886434 | 30 | virtual const char *getMACAddress(); |
geky | 0:d92b89886434 | 31 | |
Christopher Haster |
2:0978e139e1c5 | 32 | virtual int32_t getHostByName(const char *host, char *ip); |
Christopher Haster |
2:0978e139e1c5 | 33 | |
geky | 0:d92b89886434 | 34 | virtual SocketInterface *createSocket(socket_protocol_t proto); |
geky | 0:d92b89886434 | 35 | virtual void destroySocket(SocketInterface *socket); |
geky | 0:d92b89886434 | 36 | }; |
geky | 0:d92b89886434 | 37 | |
geky | 0:d92b89886434 | 38 | |
geky | 0:d92b89886434 | 39 | #endif |