[9406] | 1 | /* |
---|
| 2 | orxonox - the future of 3D-vertical-scrollers |
---|
[5530] | 3 | |
---|
[9406] | 4 | Copyright (C) 2004 orx |
---|
[5530] | 5 | |
---|
[9406] | 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | ### File Specific: |
---|
| 12 | main-programmer: Christoph Renner rennerc@ee.ethz.ch |
---|
| 13 | co-programmer: Patrick Boenzli boenzlip@orxonox.ethz.ch |
---|
| 14 | |
---|
| 15 | June 2006: finishing work on the network stream for pps presentation (rennerc@ee.ethz.ch) |
---|
| 16 | July 2006: some code rearangement and integration of the proxy server mechanism (boenzlip@ee.ethz.ch) |
---|
| 17 | */ |
---|
| 18 | |
---|
[5530] | 19 | /*! |
---|
| 20 | * @file network_manager.h |
---|
| 21 | * Main interface for the network module. Manages all the modules |
---|
| 22 | */ |
---|
| 23 | |
---|
[9406] | 24 | #ifndef _NETDEFS_H |
---|
| 25 | #define _NETDEFS_H |
---|
[5530] | 26 | |
---|
[9406] | 27 | #include "nettypes.h" |
---|
| 28 | #include "netincl.h" |
---|
[5588] | 29 | |
---|
[5605] | 30 | |
---|
[6695] | 31 | |
---|
[9406] | 32 | //!< the amount of slots used before a proxy server is activated |
---|
| 33 | #define NET_CONNECTION_SATURATION 0.75 |
---|
| 34 | |
---|
| 35 | //!< network polling frequency |
---|
[8802] | 36 | #define NETWORK_FREQUENCY 66 |
---|
[6695] | 37 | |
---|
[7954] | 38 | |
---|
[9406] | 39 | //!< orxonox protocol id |
---|
| 40 | #define _ORXONOX_ID 0xF91337A0 |
---|
| 41 | //!< orxonox network version identifier |
---|
| 42 | #define _ORXONOX_VERSION 1 |
---|
[5530] | 43 | |
---|
| 44 | |
---|
[9494] | 45 | |
---|
| 46 | |
---|
[9246] | 47 | //!< enum indicating the type of the node |
---|
[5649] | 48 | typedef enum { |
---|
[9494] | 49 | NET_UNASSIGNED = -1, |
---|
| 50 | |
---|
| 51 | NET_MASTER_SERVER = 0, |
---|
[9406] | 52 | NET_PROXY_SERVER_ACTIVE, |
---|
| 53 | NET_PROXY_SERVER_PASSIVE, |
---|
| 54 | NET_CLIENT, |
---|
| 55 | |
---|
| 56 | NET_NR_TYPES |
---|
| 57 | |
---|
[5649] | 58 | } NodeType; |
---|
| 59 | |
---|
[9494] | 60 | |
---|
[9246] | 61 | //!< enum indicating the type of the network connection (2 protocols supported) |
---|
[7954] | 62 | typedef enum ConnectionType { |
---|
| 63 | NET_UDP = 0, |
---|
| 64 | NET_TCP |
---|
| 65 | }; |
---|
[6695] | 66 | |
---|
[9494] | 67 | |
---|
| 68 | //!< the type of the unique id (special number never used elsewhere) |
---|
[6695] | 69 | typedef enum { |
---|
| 70 | NET_UID_UNASSIGNED = -1, |
---|
| 71 | |
---|
[9494] | 72 | NET_UID_HANDSHAKE = 0, |
---|
| 73 | |
---|
| 74 | |
---|
[6695] | 75 | NET_UID_NUMBER |
---|
| 76 | } UidType; |
---|
| 77 | |
---|
[9494] | 78 | |
---|
| 79 | //!< the network id list |
---|
| 80 | typedef enum nodeId { |
---|
| 81 | NET_ID_UNASSIGNED =-1, |
---|
| 82 | |
---|
| 83 | NET_ID_MASTER_SERVER = 0, |
---|
| 84 | |
---|
| 85 | NET_ID_PROXY_SERVER_01 = 1, |
---|
| 86 | NET_ID_PROXY_SERVER_02, |
---|
| 87 | NET_ID_PROXY_SERVER_03, |
---|
| 88 | NET_ID_PROXY_SERVER_04, |
---|
| 89 | NET_ID_PROXY_SERVER_05, |
---|
| 90 | NET_ID_PROXY_SERVER_06, |
---|
| 91 | NET_ID_PROXY_SERVER_07, |
---|
| 92 | NET_ID_PROXY_SERVER_08 = 8, |
---|
| 93 | |
---|
| 94 | NET_ID_PROXY_MAX = 8, |
---|
| 95 | |
---|
| 96 | NET_ID_CLIENT_01 = 9, |
---|
| 97 | NET_ID_CLIENT_02, |
---|
| 98 | NET_ID_CLIENT_03, |
---|
| 99 | NET_ID_CLIENT_04, |
---|
| 100 | NET_ID_CLIENT_05, |
---|
| 101 | NET_ID_CLIENT_06, |
---|
| 102 | NET_ID_CLIENT_07, |
---|
| 103 | NET_ID_CLIENT_08, |
---|
| 104 | NET_ID_CLIENT_09, |
---|
| 105 | NET_ID_CLIENT_10, |
---|
| 106 | NET_ID_CLIENT_11, |
---|
| 107 | NET_ID_CLIENT_12, |
---|
| 108 | NET_ID_CLIENT_13, |
---|
| 109 | NET_ID_CLIENT_14, |
---|
| 110 | NET_ID_CLIENT_15, |
---|
| 111 | NET_ID_CLIENT_16, |
---|
| 112 | NET_ID_CLIENT_17, |
---|
| 113 | NET_ID_CLIENT_18, |
---|
| 114 | NET_ID_CLIENT_19, |
---|
| 115 | NET_ID_CLIENT_20, |
---|
| 116 | NET_ID_CLIENT_21, |
---|
| 117 | NET_ID_CLIENT_22, |
---|
| 118 | NET_ID_CLIENT_23, |
---|
| 119 | NET_ID_CLIENT_24, |
---|
| 120 | NET_ID_CLIENT_25, |
---|
| 121 | NET_ID_CLIENT_26, |
---|
| 122 | NET_ID_CLIENT_27, |
---|
| 123 | NET_ID_CLIENT_28, |
---|
| 124 | NET_ID_CLIENT_29, |
---|
| 125 | NET_ID_CLIENT_30, |
---|
| 126 | NET_ID_CLIENT_31, |
---|
| 127 | NET_ID_CLIENT_32, |
---|
| 128 | NET_ID_CLIENT_33, |
---|
| 129 | NET_ID_CLIENT_34, |
---|
| 130 | NET_ID_CLIENT_35, |
---|
| 131 | NET_ID_CLIENT_36, |
---|
| 132 | NET_ID_CLIENT_37, |
---|
| 133 | NET_ID_CLIENT_38, |
---|
| 134 | NET_ID_CLIENT_39, |
---|
| 135 | NET_ID_CLIENT_40, |
---|
| 136 | |
---|
| 137 | NET_ID_CLIENT_MAX = 40 |
---|
| 138 | }; |
---|
[9406] | 139 | #endif /* _NETDEFS_H */ |
---|