hello.hh

Go to the documentation of this file.
00001 // Copyright (C) 2003, 2004, 2005 Laboratoire de Recherche en Informatique
00002 
00003 // This file is part of Qolyester.
00004 
00005 // Qolyester is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 
00010 // Qolyester is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018 
00030 
00031 #include "msg/message.hh"
00032 
00033 #ifndef QOLYESTER_DAEMON_MSG_HELLO_HH
00034 # define QOLYESTER_DAEMON_MSG_HELLO_HH 1
00035 
00036 # include <sys/types.h>
00037 # include "net/ipaddress.hh"
00038 # include "utl/data.hh"
00039 
00040 namespace olsr {
00041 
00042   namespace msg {
00043 
00044     // The HELLO message class
00045 
00050     class HELLOMessage : public Message {
00051     public:
00052 
00056       virtual ~HELLOMessage() {}
00057 
00068       virtual inline bool       dump(utl::Data&, const address_t&) const;
00069 
00075       static inline void        parse(const utl::ConstData&,
00076                                       const Message::header&);
00077 
00078     protected:
00079       // Convenience data structure of the HELLO message header.
00084       struct raw {
00085         u_int16_t       reserved;
00086         u_int8_t        htime;
00087         u_int8_t        willingness;
00088         u_int8_t        data[0];
00089       };
00090 
00091       // Additional convenience data structure of the header of the
00092       // link message.
00098       struct linksetraw {
00099         u_int8_t        linkcode;
00100         u_int8_t        reserved;
00101         u_int16_t       linkmessagesize;
00102         u_int8_t        data[0];
00103       };
00104 
00105       static const ::size_t     min_length = sizeof (raw); 
00106     };
00107 
00108   } // namespace msg
00109 
00110 } // namespace olsr
00111 
00112 # include "hello.hxx"
00113 
00114 #endif // ! QOLYESTER_DAEMON_MSG_HELLO_HH

Generated on Mon Sep 10 17:02:11 2007 for Qolyester daemon by  doxygen 1.5.1