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 bool dump(utl::Data& d, const address_t& interface) const; 00069 00075 static void parse(const utl::ConstData& d, 00076 const Message::header& mh); 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 # ifndef QOLYESTER_DONTINCLUDE_HXX 00113 # include "hello.hxx" 00114 # endif 00115 00116 #endif // ! QOLYESTER_DAEMON_MSG_HELLO_HH