![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
no working tcp
EthernetNetIf/LPC1768/if/net/netif.h@0:39a067b5ae32, 2010-12-24 (annotated)
- Committer:
- brleme
- Date:
- Fri Dec 24 00:37:51 2010 +0000
- Revision:
- 0:39a067b5ae32
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
brleme | 0:39a067b5ae32 | 1 | |
brleme | 0:39a067b5ae32 | 2 | /* |
brleme | 0:39a067b5ae32 | 3 | Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com) |
brleme | 0:39a067b5ae32 | 4 | |
brleme | 0:39a067b5ae32 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy |
brleme | 0:39a067b5ae32 | 6 | of this software and associated documentation files (the "Software"), to deal |
brleme | 0:39a067b5ae32 | 7 | in the Software without restriction, including without limitation the rights |
brleme | 0:39a067b5ae32 | 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
brleme | 0:39a067b5ae32 | 9 | copies of the Software, and to permit persons to whom the Software is |
brleme | 0:39a067b5ae32 | 10 | furnished to do so, subject to the following conditions: |
brleme | 0:39a067b5ae32 | 11 | |
brleme | 0:39a067b5ae32 | 12 | The above copyright notice and this permission notice shall be included in |
brleme | 0:39a067b5ae32 | 13 | all copies or substantial portions of the Software. |
brleme | 0:39a067b5ae32 | 14 | |
brleme | 0:39a067b5ae32 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
brleme | 0:39a067b5ae32 | 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
brleme | 0:39a067b5ae32 | 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
brleme | 0:39a067b5ae32 | 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
brleme | 0:39a067b5ae32 | 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
brleme | 0:39a067b5ae32 | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
brleme | 0:39a067b5ae32 | 21 | THE SOFTWARE. |
brleme | 0:39a067b5ae32 | 22 | */ |
brleme | 0:39a067b5ae32 | 23 | |
brleme | 0:39a067b5ae32 | 24 | #ifndef NETIF_H |
brleme | 0:39a067b5ae32 | 25 | #define NETIF_H |
brleme | 0:39a067b5ae32 | 26 | |
brleme | 0:39a067b5ae32 | 27 | #include "core/ipaddr.h" |
brleme | 0:39a067b5ae32 | 28 | /* |
brleme | 0:39a067b5ae32 | 29 | #include "nettcpsocket.h" |
brleme | 0:39a067b5ae32 | 30 | #include "netudpsocket.h" |
brleme | 0:39a067b5ae32 | 31 | #include "netdnsrequest.h" |
brleme | 0:39a067b5ae32 | 32 | */ |
brleme | 0:39a067b5ae32 | 33 | class NetTcpSocket; |
brleme | 0:39a067b5ae32 | 34 | class NetUdpSocket; |
brleme | 0:39a067b5ae32 | 35 | class NetDnsRequest; |
brleme | 0:39a067b5ae32 | 36 | |
brleme | 0:39a067b5ae32 | 37 | #if 0 |
brleme | 0:39a067b5ae32 | 38 | enum NetifEvent |
brleme | 0:39a067b5ae32 | 39 | { |
brleme | 0:39a067b5ae32 | 40 | NETIF_CONNECTED, //Connected, can create & use sockets now |
brleme | 0:39a067b5ae32 | 41 | NETIF_DNSREPLY, |
brleme | 0:39a067b5ae32 | 42 | NETIF_DISCONNECTED |
brleme | 0:39a067b5ae32 | 43 | }; |
brleme | 0:39a067b5ae32 | 44 | #endif |
brleme | 0:39a067b5ae32 | 45 | |
brleme | 0:39a067b5ae32 | 46 | class NetIf |
brleme | 0:39a067b5ae32 | 47 | { |
brleme | 0:39a067b5ae32 | 48 | public: |
brleme | 0:39a067b5ae32 | 49 | NetIf(); |
brleme | 0:39a067b5ae32 | 50 | virtual ~NetIf(); |
brleme | 0:39a067b5ae32 | 51 | virtual NetTcpSocket* tcpSocket() = 0; //Create a new tcp socket |
brleme | 0:39a067b5ae32 | 52 | virtual NetUdpSocket* udpSocket() = 0; //Create a new udp socket |
brleme | 0:39a067b5ae32 | 53 | virtual void poll() = 0; |
brleme | 0:39a067b5ae32 | 54 | virtual NetDnsRequest* dnsRequest(const char* hostname) = 0; //Create a new NetDnsRequest object |
brleme | 0:39a067b5ae32 | 55 | virtual NetDnsRequest* dnsRequest(Host* pHost) = 0; //Create a new NetDnsRequest object |
brleme | 0:39a067b5ae32 | 56 | |
brleme | 0:39a067b5ae32 | 57 | //!Returns the IP of the interface once it's connected |
brleme | 0:39a067b5ae32 | 58 | IpAddr getIp() const; |
brleme | 0:39a067b5ae32 | 59 | |
brleme | 0:39a067b5ae32 | 60 | protected: |
brleme | 0:39a067b5ae32 | 61 | IpAddr m_ip; |
brleme | 0:39a067b5ae32 | 62 | }; |
brleme | 0:39a067b5ae32 | 63 | |
brleme | 0:39a067b5ae32 | 64 | #endif |