[quagga-dev 8351] Re: [PATCH 1/7] lib: Add a function to delete all interfaces

Balaji G balajig81 at gmail.com
Tue Nov 16 05:42:50 GMT 2010


Applied, Thanks

On Thu, Nov 11, 2010 at 2:30 AM, Tom Goff <thomas.goff at boeing.com> wrote:

> if.c: (if_terminate) This adds a cleanup function that can be called
>    when a daemon exits, similar to vty_terminate().
>
> Signed-off-by: Tom Goff <thomas.goff at boeing.com>
> ---
>  lib/if.c |   18 ++++++++++++++++++
>  lib/if.h |    1 +
>  2 files changed, 19 insertions(+), 0 deletions(-)
>
> diff --git a/lib/if.c b/lib/if.c
> index e310711..b61bdbf 100644
> --- a/lib/if.c
> +++ b/lib/if.c
> @@ -878,3 +878,21 @@ if_init (void)
>
>   memset (&if_master, 0, sizeof if_master);
>  }
> +
> +void
> +if_terminate (void)
> +{
> +  for (;;)
> +    {
> +      struct interface *ifp;
> +
> +      ifp = listnode_head (iflist);
> +      if (ifp == NULL)
> +       break;
> +
> +      if_delete (ifp);
> +    }
> +
> +  list_delete (iflist);
> +  iflist = NULL;
> +}
> diff --git a/lib/if.h b/lib/if.h
> index c99ab81..841ce51 100644
> --- a/lib/if.h
> +++ b/lib/if.h
> @@ -266,6 +266,7 @@ extern int if_is_pointopoint (struct interface *);
>  extern int if_is_multicast (struct interface *);
>  extern void if_add_hook (int, int (*)(struct interface *));
>  extern void if_init (void);
> +extern void if_terminate (void);
>  extern void if_dump_all (void);
>  extern const char *if_flag_dump(unsigned long);
>
> --
> 1.7.0.4
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev at lists.quagga.net
> http://lists.quagga.net/mailman/listinfo/quagga-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20101116/9d4b5962/attachment-0001.html>


More information about the Quagga-dev mailing list