Skip to content

Starting communication

Esteban Chacon Martin edited this page Aug 20, 2022 · 1 revision

The server has the fallowing internal information structure.

/* Protocol version length */
#define PROTOLEN 32
/* Hash application identity lentgth. */
#define HASHLEN 256
struct tfproto {
/* Protocol version */
char proto[PROTOLEN];
/* Hash identity */
char hash[HASHLEN];
/* Directory for the database. */
char dbdir[PATH_MAX];
/* Number of port for comm. */
char port[PORTLEN];
}

The proto member holds the protocol version. The hash member holds a message digest that identifies the client in order to allow the use of the protocol. The dbdir member holds the directory for the data that clients require to store. The port member indicates the number of ports in which the server will listen for connections. As stated before the hash has to be less than 256 bytes long; and the proto less than 32 bytes long.

In order to match this structure when a client starts a connection, there are some steps that must be follow.