Changeset 11473 for trunk/module-gbox.h
- Timestamp:
- 01/18/19 20:17:57 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-gbox.h
r11456 r11473 4 4 #ifdef MODULE_GBOX 5 5 6 #define NO_GBOX_ID 7 #define GBOX_MAXHOPS 8 #define DEFAULT_GBOX_MAX_DIST 9 #define DEFAULT_GBOX_MAX_ECM_SEND 10 #define DEFAULT_GBOX_RESHARE 11 #define DEFAULT_CCC_GBOX_RESHARE 12 #define DEFAULT_GBOX_RECONNECT 13 #define GBOX_MIN_RECONNECT 14 #define GBOX_MAX_RECONNECT 15 #define CS_GBOX_MAX_LOCAL_CARDS 16 #define GBOX_REBROADCAST_TIMEOUT 17 #define GBOX_MIN_REBROADCAST_TIME 18 #define GBOX_SID_CONFIRM_TIME 19 #define GBOX_DEFAULT_CW_TIME 20 #define RECEIVE_BUFFER_SIZE 21 #define MIN_GBOX_MESSAGE_LENGTH 10 //CMD + pw + pw. TODO: Check if is really min22 #define MIN_ECM_LENGTH 23 #define STATS_WRITE_TIME 300 //write stats file every 5 min24 #define MAX_GBOX_CARDS 1024 //send max. 1024 to peer25 #define LOCAL_GBOX_MAJOR_VERSION 6 #define NO_GBOX_ID 0 7 #define GBOX_MAXHOPS 5 8 #define DEFAULT_GBOX_MAX_DIST 2 9 #define DEFAULT_GBOX_MAX_ECM_SEND 3 10 #define DEFAULT_GBOX_RESHARE 2 11 #define DEFAULT_CCC_GBOX_RESHARE 1 12 #define DEFAULT_GBOX_RECONNECT 180 13 #define GBOX_MIN_RECONNECT 60 14 #define GBOX_MAX_RECONNECT 300 15 #define CS_GBOX_MAX_LOCAL_CARDS 16 16 #define GBOX_REBROADCAST_TIMEOUT 1250 17 #define GBOX_MIN_REBROADCAST_TIME 100 18 #define GBOX_SID_CONFIRM_TIME 3600 19 #define GBOX_DEFAULT_CW_TIME 500 20 #define RECEIVE_BUFFER_SIZE 1024 21 #define MIN_GBOX_MESSAGE_LENGTH 10 // CMD + pw + pw. TODO: Check if is really min 22 #define MIN_ECM_LENGTH 8 23 #define STATS_WRITE_TIME 300 // write stats file every 5 min 24 #define MAX_GBOX_CARDS 1024 // send max. 1024 to peer 25 #define LOCAL_GBOX_MAJOR_VERSION 0x02 26 26 27 #define MSG_ECM 28 #define MSG_CW 29 #define MSG_HELLO 30 #define MSG_HELLO1 31 #define MSG_CHECKCODE 32 #define MSG_GOODBYE 33 #define MSG_GSMS_ACK 34 #define MSG_GSMS 35 #define MSG_HERE 27 #define MSG_ECM 0x445C 28 #define MSG_CW 0x4844 29 #define MSG_HELLO 0xDDAB 30 #define MSG_HELLO1 0x4849 31 #define MSG_CHECKCODE 0x41C0 32 #define MSG_GOODBYE 0x9091 33 #define MSG_GSMS_ACK 0x9099 34 #define MSG_GSMS 0x0FFF 35 #define MSG_HERE 0xA0A1 36 36 37 #define GBOX_ECM_NOT_ASKED 38 #define GBOX_ECM_SENT 39 #define GBOX_ECM_SENT_ALL 37 #define GBOX_ECM_NOT_ASKED 0 38 #define GBOX_ECM_SENT 1 39 #define GBOX_ECM_SENT_ALL 2 40 40 #define GBOX_ECM_SENT_ALL_TWICE 3 41 #define GBOX_ECM_ANSWERED 41 #define GBOX_ECM_ANSWERED 4 42 42 43 #define GBOX_CARD_TYPE_GBOX 44 #define GBOX_CARD_TYPE_LOCAL 45 #define GBOX_CARD_TYPE_BETUN 46 #define GBOX_CARD_TYPE_CCCAM 47 #define GBOX_CARD_TYPE_PROXY 43 #define GBOX_CARD_TYPE_GBOX 0 44 #define GBOX_CARD_TYPE_LOCAL 1 45 #define GBOX_CARD_TYPE_BETUN 2 46 #define GBOX_CARD_TYPE_CCCAM 3 47 #define GBOX_CARD_TYPE_PROXY 4 48 48 49 49 #define FILE_GBOX_VERSION "gbox.ver" … … 56 56 #define FILE_LOCAL_CARDS_INFO "sc.info" 57 57 58 #define MSGID_GOODNIGHT 59 #define MSGID_GSMS 60 #define MSGID_GONEOFFLINE 61 #define MSGID_COMEONLINE 62 #define MSGID_GOODBYE 63 #define MSGID_LOSTCONNECT 64 #define MSGID_ATTACK 65 #define MSGID_IPCHANGE 66 #define MSGID_GBOXONL 67 #define MSGID_UNKNOWNMSG 68 #define MSGID_REMM 58 #define MSGID_GOODNIGHT 0 59 #define MSGID_GSMS 1 60 #define MSGID_GONEOFFLINE 2 61 #define MSGID_COMEONLINE 3 62 #define MSGID_GOODBYE 4 63 #define MSGID_LOSTCONNECT 5 64 #define MSGID_ATTACK 6 65 #define MSGID_IPCHANGE 7 66 #define MSGID_GBOXONL 8 67 #define MSGID_UNKNOWNMSG 9 68 #define MSGID_REMM 12 69 69 70 #define GBOX_STAT_HELLOL 71 #define GBOX_STAT_HELLOS 72 #define GBOX_STAT_HELLOR 70 #define GBOX_STAT_HELLOL 0 71 #define GBOX_STAT_HELLOS 1 72 #define GBOX_STAT_HELLOR 2 73 73 74 #define GBOX_DELETE_FROM_PEER 75 #define GBOX_DELETE_WITH_ID 76 #define GBOX_DELETE_WITH_TYPE 74 #define GBOX_DELETE_FROM_PEER 0 75 #define GBOX_DELETE_WITH_ID 1 76 #define GBOX_DELETE_WITH_TYPE 2 77 77 78 #define GBOX_PEER_OFFLINE 79 #define GBOX_PEER_ONLINE 78 #define GBOX_PEER_OFFLINE 0 79 #define GBOX_PEER_ONLINE 1 80 80 81 #define GBOX_ATTACK_LOCAL_PW 82 #define GBOX_ATTACK_PEER_IGNORE 83 #define GBOX_ATTACK_PEER_PW 84 #define GBOX_ATTACK_AUTH_FAIL 85 #define GBOX_ATTACK_ECM_BLOCKED 86 #define GBOX_ATTACK_REMM_REQ_BLOCKED 81 #define GBOX_ATTACK_LOCAL_PW 0 82 #define GBOX_ATTACK_PEER_IGNORE 1 83 #define GBOX_ATTACK_PEER_PW 2 84 #define GBOX_ATTACK_AUTH_FAIL 3 85 #define GBOX_ATTACK_ECM_BLOCKED 4 86 #define GBOX_ATTACK_REMM_REQ_BLOCKED 5 87 87 88 88 #define LOCALCARDEJECTED 1 89 #define LOCALCARDUP 289 #define LOCALCARDUP 2 90 90 91 struct gbox_rbc_thread_args 91 struct gbox_rbc_thread_args 92 92 { 93 94 95 93 struct s_client *cli; 94 ECM_REQUEST *er; 95 uint32_t waittime; 96 96 }; 97 97 98 98 struct gbox_srvid 99 99 { 100 101 100 uint16_t sid; 101 uint32_t provid_id; 102 102 }; 103 103 104 104 struct gbox_good_srvid 105 105 { 106 107 106 struct gbox_srvid srvid; 107 time_t last_cw_received; 108 108 }; 109 109 110 110 struct gbox_bad_srvid 111 111 { 112 113 112 struct gbox_srvid srvid; 113 uint8_t bad_strikes; 114 114 }; 115 115 116 116 struct gbox_card_id 117 117 { 118 119 118 uint16_t peer; 119 uint8_t slot; 120 120 }; 121 121 122 122 struct gbox_card_pending 123 123 { 124 125 124 struct gbox_card_id id; 125 uint32_t pending_time; 126 126 }; 127 127 128 128 struct gbox_card 129 129 { 130 131 132 133 134 135 136 LLIST *goodsids; //sids that could be decoded (struct gbox_srvid)137 138 139 130 struct gbox_card_id id; 131 uint32_t caprovid; 132 uint8_t dist; 133 uint8_t lvl; 134 uint8_t type; 135 LLIST *badsids; // sids that have failed to decode (struct gbox_srvid) 136 LLIST *goodsids; // sids that could be decoded (struct gbox_srvid) 137 uint32_t no_cws_returned; 138 uint32_t average_cw_time; 139 struct gbox_peer *origin_peer; 140 140 }; 141 141 142 142 struct gbox_data 143 143 { 144 145 146 147 144 uint16_t id; 145 uint32_t password; 146 uint8_t minor_version; 147 uint8_t cpu_api; 148 148 }; 149 149 150 150 struct gbox_peer 151 151 { 152 struct gbox_data gbox; 153 uchar *hostname; 154 uchar checkcode[7]; 155 int8_t online; 156 uint8_t onlinestat; 157 uint8_t authstat; 158 uint8_t next_hello; 159 uint8_t gbox_rev; 160 uchar ecm_idx; 161 CS_MUTEX_LOCK lock; 162 struct s_client *my_user; 163 uint16_t filtered_cards; 164 uint16_t total_cards; 165 152 struct gbox_data gbox; 153 uint8_t *hostname; 154 uint8_t checkcode[7]; 155 int8_t online; 156 uint8_t onlinestat; 157 uint8_t authstat; 158 uint8_t next_hello; 159 uint8_t gbox_rev; 160 uint8_t ecm_idx; 161 CS_MUTEX_LOCK lock; 162 struct s_client *my_user; 163 uint16_t filtered_cards; 164 uint16_t total_cards; 166 165 }; 167 166 168 167 struct gbox_ecm_request_ext 169 168 { 170 uint8_tgbox_hops;171 uint16_tgbox_peer;172 uint16_tgbox_mypeer;173 uint8_tgbox_slot;174 uint8_tgbox_version;175 uint8_tgbox_rev;176 uint8_tgbox_type;177 uchargbox_routing_info[GBOX_MAXHOPS];169 uint8_t gbox_hops; 170 uint16_t gbox_peer; 171 uint16_t gbox_mypeer; 172 uint8_t gbox_slot; 173 uint8_t gbox_version; 174 uint8_t gbox_rev; 175 uint8_t gbox_type; 176 uint8_t gbox_routing_info[GBOX_MAXHOPS]; 178 177 }; 179 178 … … 184 183 uint8_t get_peer_onl_status(uint16_t peer_id); 185 184 uint32_t gbox_get_local_gbox_password(void); 186 void gbox_send(struct s_client *cli, u char*buf, int32_t l);187 int8_t gbox_message_header(u char*buf, uint16_t cmd, uint32_t peer_password, uint32_t local_password);185 void gbox_send(struct s_client *cli, uint8_t *buf, int32_t l); 186 int8_t gbox_message_header(uint8_t *buf, uint16_t cmd, uint32_t peer_password, uint32_t local_password); 188 187 void gbox_free_cards_pending(ECM_REQUEST *er); 189 188 void gbox_send_good_night(void);
Note:
See TracChangeset
for help on using the changeset viewer.