Dependencies:   mbed

Committer:
gbeardall
Date:
Mon Oct 17 10:39:17 2011 +0000
Revision:
0:715023d993d6

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gbeardall 0:715023d993d6 1
gbeardall 0:715023d993d6 2 /*
gbeardall 0:715023d993d6 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
gbeardall 0:715023d993d6 4
gbeardall 0:715023d993d6 5 Permission is hereby granted, free of charge, to any person obtaining a copy
gbeardall 0:715023d993d6 6 of this software and associated documentation files (the "Software"), to deal
gbeardall 0:715023d993d6 7 in the Software without restriction, including without limitation the rights
gbeardall 0:715023d993d6 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
gbeardall 0:715023d993d6 9 copies of the Software, and to permit persons to whom the Software is
gbeardall 0:715023d993d6 10 furnished to do so, subject to the following conditions:
gbeardall 0:715023d993d6 11
gbeardall 0:715023d993d6 12 The above copyright notice and this permission notice shall be included in
gbeardall 0:715023d993d6 13 all copies or substantial portions of the Software.
gbeardall 0:715023d993d6 14
gbeardall 0:715023d993d6 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
gbeardall 0:715023d993d6 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
gbeardall 0:715023d993d6 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
gbeardall 0:715023d993d6 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
gbeardall 0:715023d993d6 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
gbeardall 0:715023d993d6 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
gbeardall 0:715023d993d6 21 THE SOFTWARE.
gbeardall 0:715023d993d6 22 */
gbeardall 0:715023d993d6 23
gbeardall 0:715023d993d6 24 #ifndef LWIPNETIF_H
gbeardall 0:715023d993d6 25 #define LWIPNETIF_H
gbeardall 0:715023d993d6 26
gbeardall 0:715023d993d6 27 //class Ticker;
gbeardall 0:715023d993d6 28 #include "mbed.h"
gbeardall 0:715023d993d6 29
gbeardall 0:715023d993d6 30 #define NET_LWIP_STACK 1
gbeardall 0:715023d993d6 31 #include "core/net.h"
gbeardall 0:715023d993d6 32 #include "if/net/netif.h"
gbeardall 0:715023d993d6 33 /*
gbeardall 0:715023d993d6 34 #include "lwipNetTcpSocket.h"
gbeardall 0:715023d993d6 35 #include "lwipNetUdpSocket.h"
gbeardall 0:715023d993d6 36 #include "lwipNetDnsRequest.h"
gbeardall 0:715023d993d6 37 */
gbeardall 0:715023d993d6 38
gbeardall 0:715023d993d6 39 class LwipNetIf : public NetIf
gbeardall 0:715023d993d6 40 {
gbeardall 0:715023d993d6 41 public:
gbeardall 0:715023d993d6 42 LwipNetIf();
gbeardall 0:715023d993d6 43 virtual ~LwipNetIf();
gbeardall 0:715023d993d6 44
gbeardall 0:715023d993d6 45 void init();
gbeardall 0:715023d993d6 46
gbeardall 0:715023d993d6 47 virtual NetTcpSocket* tcpSocket(); //Create a new tcp socket
gbeardall 0:715023d993d6 48 virtual NetUdpSocket* udpSocket(); //Create a new udp socket
gbeardall 0:715023d993d6 49 virtual NetDnsRequest* dnsRequest(const char* hostname); //Create a new NetDnsRequest object
gbeardall 0:715023d993d6 50 virtual NetDnsRequest* dnsRequest(Host* pHost); //Create a new NetDnsRequest object
gbeardall 0:715023d993d6 51
gbeardall 0:715023d993d6 52 virtual void poll();
gbeardall 0:715023d993d6 53
gbeardall 0:715023d993d6 54 private:
gbeardall 0:715023d993d6 55 Timer m_tcpTimer;
gbeardall 0:715023d993d6 56 Timer m_dnsTimer;
gbeardall 0:715023d993d6 57
gbeardall 0:715023d993d6 58 bool m_init;
gbeardall 0:715023d993d6 59
gbeardall 0:715023d993d6 60 };
gbeardall 0:715023d993d6 61
gbeardall 0:715023d993d6 62 #endif