Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Iface.h

Go to the documentation of this file.
00001 /*
00002  * Dibbler - a portable DHCPv6
00003  *
00004  * authors: Tomasz Mrugalski <thomson@klub.com.pl>
00005  *          Marek Senderski <msend@o2.pl>
00006  *
00007  * released under GNU GPL v2 or later licence
00008  *
00009  * $Id: Iface.h,v 1.7 2004/12/27 20:48:22 thomson Exp $
00010  *
00011  * $Log: Iface.h,v $
00012  * Revision 1.7  2004/12/27 20:48:22  thomson
00013  * Problem with absent link local addresses fixed (bugs #90, #91)
00014  *
00015  * Revision 1.6  2004/11/01 23:31:25  thomson
00016  * New options,option handling mechanism and option renewal implemented.
00017  *
00018  * Revision 1.5  2004/10/25 20:45:53  thomson
00019  * Option support, parsers rewritten. ClntIfaceMgr now handles options.
00020  *
00021  */
00022 
00023 #ifndef IFACEIFACE_H
00024 #define IFACEIFACE_H
00025 
00026 #include "Portable.h"
00027 #include "SmartPtr.h"
00028 #include "Container.h"
00029 #include "SocketIPv6.h"
00030 #include "IPv6Addr.h"
00031 
00032 /*
00033  * represents network interface 
00034  */
00035 class TIfaceIface{
00036  public:
00037     friend ostream & operator <<(ostream & strum, TIfaceIface &x);
00038 
00039     TIfaceIface(char * name, int id, unsigned int flags, char* mac, 
00040                 int maclen, char* llAddr, int llAddrCnt, int hwType);
00041     char * getName();
00042     int getID();
00043 
00044     // ---flags related---
00045     unsigned int getFlags();
00046     bool flagUp();
00047     bool flagRunning();
00048     bool flagMulticast();
00049     bool flagLoopback();
00050 
00051     // ---layer-2 related---
00052     int   getMacLen();
00053     char* getMac();
00054     int   getHardwareType();
00055     char* firstLLAddress();
00056     char* getLLAddress();
00057     int   countLLAddress();
00058 
00059     // ---address related---
00060     bool addAddr(SmartPtr<TIPv6Addr> addr, long pref, long valid);
00061     bool delAddr(SmartPtr<TIPv6Addr> addr);
00062     bool updateAddr(SmartPtr<TIPv6Addr> addr, long pref, long valid);
00063     
00064     // ---socket related---
00065     bool addSocket(SmartPtr<TIPv6Addr> addr,int port, bool ifaceonly, bool reuse);
00066     bool addSocket(int port, bool ifaceonly, bool reuse); 
00067     bool delSocket(int id);
00068     void firstSocket();
00069     SmartPtr <TIfaceSocket> getSocketByFD(int fd);
00070     SmartPtr <TIfaceSocket> getSocket();
00071     int countSocket();
00072 
00073     ~TIfaceIface();
00074 
00075  protected:
00076     // ---interface data---
00077     char Name[MAX_IFNAME_LENGTH];
00078     int ID;
00079     unsigned int Flags;
00080     char* Mac;
00081     int Maclen;
00082     char* LLAddr;
00083     int LLAddrCnt;
00084     int HWType;
00085 
00086     // sockets
00087     TContainer< SmartPtr<TIfaceSocket> > SocketsLst;
00088     char*   PresLLAddr;
00089 };
00090 
00091 #endif
00092 

Generated on Mon Dec 27 21:55:22 2004 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1