Hello Everybody,
I have been trying to understand the example code provided for GARP in
802.1d 1998 edition.There are certain variables for which I am not able to understand their significance as regard to the code implementation. If someone has implemented/studied this kindly suggest if my understanding is correct.
There is a variable in Garp.h file
unsigned last_gid_used;
and it has been used at numerous places in the code.
I am giving excerpts from the example implementation in the standard
e.g
(1)in Gid.c under gid_create_gid as follows -
my_port->last_transmitted = application->last_gid_used; my_port->last_to_transmit = application->last_gid_used;
Here I am assume that they are trying to make sure that at the time when GID instance is created for this port it should be in default, i.e insure to this port/instance that there are transmissions pending
(2) It has been used in Destroy GID as well where I assume code is going through the whole array of GID instances and seeing if the instances which are registered and then destroying them
static void gid_destroy_gid(Gid *gid) { unsigned gid_index; for (gid_index = 0; gid_index application-
{ if (gid_registered_here(gid, gid_index)) gid->application->leave_indication_fn(gid->application, gid, gid_index); } sysfree(gid->machines); sysfree(gid); }
(3) static void gid_leaveall(Gid *my_port) { /*
- only for shared media at present
I am having problems undestanding the code at this point because I was assuming that last_gid_used is keeping track of the number og gid instances created for the application
But above code is used for sending leaveall messages to all the state machines of a port(Participant) How come we are using last_gid_used? Should not we use upper_limit of gid machines allowed per port
Kindly correct me my understanding??
Your help would be highly appreciated.
Thanks in advance. Sincerely, Jassy.