rip_interface_wakeup is scheduled to wakeup via this code:
ri->t_wakeup = thread_add_timer (master, rip_interface_wakeup,
ifp, 1);
If you look ifp is passed in. thread_add_timer corresponds to:
/* Add timer event thread. */
struct thread *
funcname_thread_add_timer (struct thread_master *m,
int (*func) (struct thread *),
void *arg, long timer, const char* funcname)
{
ifp becomes void *arg for this function, and the value is stored in
thread->arg in thread_get that is eventually called..
When the timer pops thread->func is called with thread->arg in
thread_call();
donald
On Wed, Apr 8, 2015 at 1:37 AM, srujan k <[email protected]> wrote:
> Hi Devteam,
>
> I am going through the source code of RIP. I am not able to understand how
> the function "rip_interface_wakeup" is filled with interface structure.
>
> There is a call ifp = THREAD_ARG (t);, after this call ifp is filled
> with interface detail. I am not able to understand how THREAD_ARG is used
> to fill ifp structure.
>
>
> The thread structure has following details.
> * Thread itself. */
> struct thread
> {
> thread_type type; /* thread type */
> thread_type add_type; /* thread type */
> struct thread *next; /* next pointer of the thread */
> struct thread *prev; /* previous pointer of the thread */
> struct thread_master *master; /* pointer to the struct thread_master.
> */
> int (*func) (struct thread *); /* event function */
> void *arg; /* event argument */
> union {
> int val; /* second argument of the event. */
> int fd; /* file descriptor in case of read/write. */
> struct timeval sands; /* rest of time sands value. */
> } u;
> RUSAGE_T ru; /* Indepth usage info. */
> struct cpu_thread_history *hist; /* cache pointer to cpu_history */
> * char* funcname;*
> };
>
> Can some one point to me to understand the code flow to start with.
>
> Regards,
> Srujan
>
> _______________________________________________
> Quagga-dev mailing list
> [email protected]
> https://lists.quagga.net/mailman/listinfo/quagga-dev
>
>
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev