typedef struct {
int state ; (*)
int id ; (*)
int adjacents; (*)
PORT *adjust ;
int step_dur [3] ;
MESSAGE *mes_buf ;
TIMER clock[5] ;
int loc_clock ;
double dr_loc_clock ;
int wake_time ;
int sy_init_time ;
int dpq ;
double dr_dpq ;
int step ;
int cycle ;
int idle ;
int init_time ;
} PCBS ;
typedef struct {
int id;
int delays [3] ;
int state;
int weight;
} PORT ;
typedef struct {
int parent ;
LIST ack ;
.......
} REGISTERS ;
REGISTERS *REG ;
Each node i can then refer to its local variable parent as REG[i].parent
These local variables may be initialized in a procedure init() and must be allocated enough memory for them in a procedure reg_alloc() (these should be taken care of in the action file, at the creation of the protocol; cf. section on protocol creation) e.g.
reg_alloc()
{
REG = (REGISTERS *)malloc (processes * sizeof (REGISTERS));
}
Moreover, there are also available routines in LYDIAN which are useful for the user (see Section 7.2
Now, we have enough information to implement the protocol of the Broadcast with ACK algorithm.