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.11 2005/01/23 23:17:53 thomson Exp $
00010  *
00011  * $Log: Iface.h,v $
00012  * Revision 1.11  2005/01/23 23:17:53  thomson
00013  * Relay/global address support related improvements.
00014  *
00015  * Revision 1.10  2005/01/13 22:45:55  thomson
00016  * Relays implemented.
00017  *
00018  * Revision 1.9  2005/01/11 22:53:35  thomson
00019  * Relay skeleton implemented.
00020  *
00021  * Revision 1.8  2005/01/03 21:53:41  thomson
00022  * const modifier added.
00023  *
00024  * Revision 1.7  2004/12/27 20:48:22  thomson
00025  * Problem with absent link local addresses fixed (bugs #90, #91)
00026  *
00027  * Revision 1.6  2004/11/01 23:31:25  thomson
00028  * New options,option handling mechanism and option renewal implemented.
00029  *
00030  * Revision 1.5  2004/10/25 20:45:53  thomson
00031  * Option support, parsers rewritten. ClntIfaceMgr now handles options.
00032  *
00033  */
00034 
00035 #ifndef IFACEIFACE_H
00036 #define IFACEIFACE_H
00037 
00038 #include "Portable.h"
00039 #include "SmartPtr.h"
00040 #include "Container.h"
00041 #include "SocketIPv6.h"
00042 #include "IPv6Addr.h"
00043 
00044 /*
00045  * represents network interface 
00046  */
00047 class TIfaceIface{
00048  public:
00049     friend ostream & operator <<(ostream & strum, TIfaceIface &x);
00050 
00051     TIfaceIface(const char * name, int id, unsigned int flags, char* mac, 
00052                 int maclen, char* llAddr, int llAddrCnt, char * globalAddr, int globalCnt, int hwType);
00053     char * getName();
00054     int getID();
00055     string getFullName();
00056 
00057     // ---flags related---
00058     unsigned int getFlags();
00059     bool flagUp();
00060     bool flagRunning();
00061     bool flagMulticast();
00062     bool flagLoopback();
00063 
00064     // ---layer-2 related---
00065     int   getMacLen();
00066     char* getMac();
00067     int   getHardwareType();
00068     char* firstLLAddress();
00069     char* getLLAddress();
00070     int   countLLAddress();
00071 
00072     SmartPtr<TIPv6Addr> getGlobalAddr();
00073 
00074     // ---address related---
00075     bool addAddr(SmartPtr<TIPv6Addr> addr, long pref, long valid);
00076     bool delAddr(SmartPtr<TIPv6Addr> addr);
00077     bool updateAddr(SmartPtr<TIPv6Addr> addr, long pref, long valid);
00078     
00079     // ---socket related---
00080     bool addSocket(SmartPtr<TIPv6Addr> addr,int port, bool ifaceonly, bool reuse);
00081     bool addSocket(int port, bool ifaceonly, bool reuse); 
00082     bool delSocket(int id);
00083     void firstSocket();
00084     SmartPtr <TIfaceSocket> getSocketByFD(int fd);
00085     SmartPtr <TIfaceSocket> getSocket();
00086     int countSocket();
00087 
00088     ~TIfaceIface();
00089 
00090  protected:
00091     // ---interface data---
00092     char Name[MAX_IFNAME_LENGTH];
00093     int ID;
00094     unsigned int Flags;
00095     char* Mac;
00096     int Maclen;
00097     char* LLAddr;
00098     int LLAddrCnt;
00099     char * GlobalAddr;
00100     int GlobalAddrCnt;
00101     
00102     int HWType;
00103 
00104     // sockets
00105     TContainer< SmartPtr<TIfaceSocket> > SocketsLst;
00106     char*   PresLLAddr;
00107 };
00108 
00109 #endif
00110 

Generated on Wed Mar 16 00:10:25 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1