Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/lib/network/network_protocol.h @ 6060

Last change on this file since 6060 was 6060, checked in by bwuest, 18 years ago

Network changes

File size: 743 bytes
Line 
1/*!
2
3*/
4
5#ifndef _NETWORK_PROTOCOL_H
6#define _NETWORK_PROTOCOL_H
7
8#include "base_object.h"
9
10/* include this file, it contains some default definitions */
11#include "netdefs.h"
12
13#define HEADER_LENGTH 1
14
15typedef struct Header
16{
17  byte protocol;
18  byte version;
19  byte synchronizeableID;
20  byte length;
21};
22
23class Synchronizeable;
24
25/*!
26
27*/
28class NetworkProtocol : virtual public BaseObject
29{
30  public:
31    NetworkProtocol();
32    ~NetworkProtocol();
33
34    int createHeader(byte* data, int length, int bufferLength, const Synchronizeable& source);
35    Header extractHeader(byte* data, int length);
36
37  private:
38    unsigned int headerLength; //The Length of the Header in bytes
39};
40
41#endif //_NETWORK_PROTOCOL_H
Note: See TracBrowser for help on using the repository browser.