/*! \file include/rap.h \brief robos ad-hoc protocol \author Eric B. Decker $Id: rap.h,v 1.8 2004/03/02 21:37:46 luca Exp $ */ /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * Original Code: RAP code, released February 16, 2004 * * The Initial Developer of the Original Code is Eric B. Decker * Portions created by Eric B. Decker are Copyright (C) 2004 * Eric B. Decker, All Rights Reserved. * * Contributor(s): Eric B. Decker * Contributor(s): Luca de Alfaro */ #ifndef __rap_h__ #define __rap_h__ /* This header does not check for CONF_RAP because it is used by both the legos/ROBOS side as well as on the Unix/Linux side. */ typedef struct { unsigned char len; // Len unsigned char data[0]; // List } rap_list_t; typedef struct { unsigned char dtype; // Upper layer type. Not used. unsigned char dlen; // Length of data to upper layer. unsigned char data[0]; // Data for upper layer. } rap_data_t; // Structure to interpret packets typedef struct { unsigned char len; // length of packet (total) unsigned char ptype; // packet type unsigned char dst; // destination unsigned char src; // source unsigned char nonce; // nonce unsigned char sr_ptr; // next hop (pointer in source route) rap_list_t sr; // source route } rap_pkt_t; // Packet types typedef enum { PTYPE_RR = 1, /* Route Request */ PTYPE_RP = 2, /* Route Reply */ PTYPE_RC = 3, /* Route Confirm */ PTYPE_AK = 4, /* Network ACK */ PTYPE_DT = 5 /* Data */ } rap_ptype_t; #define HEADER_LEN 6 // Length of the header, to compute where to // put lists. #endif /* _rap_h_ */ // $Log: rap.h,v $ // Revision 1.8 2004/03/02 21:37:46 luca // fixed [0] for struct declarations // // Revision 1.7 2004/03/01 07:13:35 luca // Added HEADER_LEN for convenience. // // Revision 1.6 2004/03/01 06:36:56 luca // Changed the names of some fields (and corresponding defines) // // Revision 1.5 2004/03/01 02:31:26 luca // Added a log. // // Revision 1.4 2004/03/01 02:31:06 luca // Modified the content of upper-layer data, to include a length. //