4 * The secure anycast tunneling protocol (satp) defines a protocol used
5 * for communication between any combination of unicast and anycast
6 * tunnel endpoints. It has less protocol overhead than IPSec in Tunnel
7 * mode and allows tunneling of every ETHER TYPE protocol (e.g.
8 * ethernet, ip, arp ...). satp directly includes cryptography and
9 * message authentication based on the methodes used by SRTP. It is
10 * intended to deliver a generic, scaleable and secure solution for
11 * tunneling and relaying of packets of any protocol.
14 * Copyright (C) 2007 anytun.org <satp@wirdorange.org>
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2
18 * as published by the Free Software Foundation.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program (see the file COPYING included with this
27 * distribution); if not, write to the Free Software Foundation, Inc.,
28 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #ifndef _PLAIN_PACKET_H_
32 #define _PLAIN_PACKET_H_
34 #include "datatypes.h"
39 * plain SATP packet class<br>
40 * includes payload_type and payload
43 class PlainPacket
: public Buffer
50 * @param max_payload_length maximum payload length
52 PlainPacket(u_int32_t max_payload_length
);
55 * Get the payload type
56 * @return the id of the payload type
58 payload_type_t
getPayloadType() const;
61 * Set the payload type
62 * @param payload_type payload type id
64 void setPayloadType(payload_type_t payload_type
);
66 void setCompletePayloadLength(u_int32_t payload_length
);
69 * Set the real payload length
70 * @param length the real payload length
72 //void setRealPayloadLengt(u_int32_t length);
75 * Get the real payload length
76 * @return the real length of the payload
78 //u_int32_t getRealPayloadLength();
81 * Set the length of the payload
82 * @param length length of the payload
84 void setLength(u_int32_t length
);
87 * Get the size of the allocated memory for the payload
88 * @return maximum size of payload
90 u_int32_t
getMaxLength() const;
94 PlainPacket(const PlainPacket
&src
);
96 u_int32_t max_length_
;
97 payload_type_t
* payload_type_
;
100 u_int8_t
* complete_payload_
;
101 u_int32_t complete_payload_length_
;