#define CUR_UREG_VERSION 1 /* Version for the register protocol */
#define SUCCESS 0 /* General purpose success code */
#define FAILURE 1 /* To use when any non-zero number will work */
-#define min(a,b) ((a)>(b)?(b):(a))
+#define min(a,b) ((a) > (b) ? (b) : (a))
#define MIN_UNAME 3 /* Username must be between three and */
#define MAX_UNAME 8 /* eight characters long. */
#define CRYPT_LEN 14 /* crypt() returns a 13 char string */
extern int errno; /* Unix error number */
/* This structure holds information from the MOIRA database that will be
- worth holding on to. An instance of it appears in the formatted
+ worth holding on to. An instance of it appears in the formatted
packet structure. */
struct db_data
{
- char mit_id[CRYPT_LEN]; /* Encrypted MIT ID */
- int reg_status; /* Registration status */
- char uid[UID_LEN]; /* Reserved uid */
- char login[LOGIN_LEN]; /* Login (username) */
+ char mit_id[CRYPT_LEN]; /* Encrypted MIT ID */
+ int reg_status; /* Registration status */
+ char uid[UID_LEN]; /* Reserved uid */
+ char login[LOGIN_LEN]; /* Login (username) */
};
-/* This structure stores information sent over in the packet in a
- more convenient format and also stores some information obtained
+/* This structure stores information sent over in the packet in a
+ more convenient format and also stores some information obtained
from the database that will be needed for each transaction. It
initialized from format_pkt() and find_user(). */
struct msg
-{
- U_32BIT version; /* User registration protocol version */
- U_32BIT request; /* Request */
- char *first; /* First name */
- char *last; /* Last name */
- char *encrypted; /* Encrypted information in packet */
- int encrypted_len; /* Length of encrypted information in packet */
- char *leftover; /* Leftover information sent in the packet */
- int leftover_len; /* Length of leftover information */
- struct db_data db; /* Information from the MOIRA database */
+{
+ U_32BIT version; /* User registration protocol version */
+ U_32BIT request; /* Request */
+ char *first; /* First name */
+ char *last; /* Last name */
+ char *encrypted; /* Encrypted information in packet */
+ int encrypted_len; /* Length of encrypted information in packet */
+ char *leftover; /* Leftover information sent in the packet */
+ int leftover_len; /* Length of leftover information */
+ struct db_data db; /* Information from the MOIRA database */
};
void failure_alert(); /* Log an unexplainable failure */