moved address lists to state variable

This commit is contained in:
Sergey Dorofeev
2012-02-23 16:33:52 +04:00
parent 1aff894fc3
commit 3e9e152054
17 changed files with 275 additions and 240 deletions
+2 -2
View File
@@ -65,8 +65,8 @@ typedef enum binkp_mode {
typedef struct {
s_sysaddr *addrs;
int anum;
// s_sysaddr *addrs;
// int anum;
char passwd[BINKP_MAXPASSWD+1];
char systname[BINKP_MAXSYSTNAME+1];
char location[BINKP_MAXLOCATION+1];
+2 -2
View File
@@ -143,8 +143,8 @@ struct emsi
* {EMSI_DAT} (main handshake information)
*/
bool have_emsi;
s_sysaddr *addrs; /* dynamicaly allocated array */
int anum; /* number of used entries in it */
// s_sysaddr *addrs; /* dynamicaly allocated array */
// int anum; /* number of used entries in it */
char passwd[EMSI_MAXPASSWD+1];
s_linkcodes linkcodes; /* XXn linkcodes contained in eaddr */
s_compcodes compcodes;
+2 -2
View File
@@ -22,8 +22,8 @@
*/
typedef struct
{
s_sysaddr *addrs; /* FTN address */
int anum;
// s_sysaddr *addrs; /* FTN address */
// int anum;
int product_code; /* product code */
int version_maj; /* major revision of the product */
int version_min; /* minor revision of the product */
+19 -10
View File
@@ -20,6 +20,14 @@
#include "io.h"
#include "nodelist.h"
#include "outbound.h"
typedef struct sysaddr {
s_faddr addr;
bool busy;
bool good;
int flags;
} s_sysaddr;
#include "prot_common.h"
#ifdef NETSPOOL
@@ -62,13 +70,6 @@ typedef enum reqstat {
#define HRC_TEMP_ERR 7 /* Any other temporary handshake error */
#define HRC_OTHER_ERR 8 /* Any other error (e.g. timeout, NO CARRIER) */
typedef struct sysaddr {
s_faddr addr;
bool busy;
bool good;
int flags;
} s_sysaddr;
typedef struct {
char passwd[128];
char challenge[128];
@@ -109,7 +110,7 @@ typedef struct handshake_protocol
/*
* 2. Remote system information extract methods
*/
s_faddr* (*remote_address)(struct handshake_protocol *THIS);
// s_faddr* (*remote_address)(struct handshake_protocol *THIS);
char* (*remote_password)(struct handshake_protocol *THIS);
char* (*remote_sysop_name)(struct handshake_protocol *THIS);
char* (*remote_system_name)(struct handshake_protocol *THIS);
@@ -122,7 +123,7 @@ typedef struct handshake_protocol
/*
* 3. Local system information extract methods
*/
s_faddr* (*local_address)(struct handshake_protocol *THIS);
// s_faddr* (*local_address)(struct handshake_protocol *THIS);
char* (*local_password)(struct handshake_protocol *THIS);
} s_handshake_protocol;
@@ -162,6 +163,10 @@ const s_modemport *modemport;
#ifdef NETSPOOL
s_netspool_state netspool;
#endif
s_sysaddr *remoteaddrs;
int n_remoteaddr;
s_sysaddr *localaddrs;
int n_localaddr;
};
typedef struct state s_state;
@@ -187,7 +192,8 @@ int session_init_outgoing();
int session_init_incoming();
/* s_main.c */
extern s_state state;
extern s_state state; // IF YOU WANT MAKE THIS PROGRAM MULTITHREAD, MAKE THIS VARIBLE LOCAL TO THE THREADS AND PASS IT TO SUBROUTINES
// YOU SHOULD ADD IT TO ALL FUNCTIONS: IT IS MANY OF HANDWORK BUT EASY TO DO
s_faddr *session_get_bestaka(s_faddr addr);
int session_addrs_lock(s_sysaddr *addrs, int anum);
@@ -213,6 +219,9 @@ void session_traffic(void);
void session_update_history(s_traffic *send, s_traffic *recv, int rc);
int session(void);
s_faddr* session_1remote_address();
s_faddr* session_1local_address();
/* sess_call.c */
int call_system(s_faddr addr, const s_bforce_opts *opts);
int call_system_modem(void);