Dependents: SimpleLCDClock readCard2Twitter_http AnalogClock_StepperMotor_NTP ServoCamV1
Diff: if/net/netif.h
- Revision:
- 0:3717b703f76d
- Child:
- 1:e52ec2a24c6a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/if/net/netif.h Mon May 24 10:23:42 2010 +0000 @@ -0,0 +1,34 @@ +#ifndef NETIF_H +#define NETIF_H + +#include "ipaddr.h" +#include "nettcpsocket.h" +#include "netudpsocket.h" +#include "netdnsrequest.h" + +#if 0 +enum NetifEvent +{ + NETIF_CONNECTED, //Connected, can create & use sockets now + NETIF_DNSREPLY, + NETIF_DISCONNECTED +}; +#endif + +class NetIf +{ +public: + NetIf(); + virtual ~NetIf(); + virtual NetTcpSocket* tcpSocket() = 0; //Create a new tcp socket + virtual NetUdpSocket* udpSocket() = 0; //Create a new udp socket + virtual void poll() = 0; + virtual NetDnsRequest* dnsRequest(const char* hostname) = 0; //Create a new NetDnsRequest object + virtual NetDnsRequest* dnsRequest(Host* pHost) = 0; //Create a new NetDnsRequest object + IpAddr getIp() const; + +protected: + IpAddr m_ip; +}; + +#endif