History

ipmr: ip6mr: Create new sockopt to clear mfc cache or vifs

Currently the only way to clear the forwarding cache was to delete the entries one by one using the MRT_DEL_MFC socket option or to destroy and recreate the socket. Create a new socket option which with the use of optional flags can clear any combination of multicast entries (static or not static) and multicast vifs (static or not static). Calling the new socket option MRT_FLUSH with the flags MRT_FLUSH_MFC and MRT_FLUSH_VIFS will clear all entries and vifs on the socket except for static entries.

Callum Sinclair committed 7 years ago

Commit ca8d4791 parent fd8ca894 files · +115 −56Browse files

Showing the changes to include/uapi/linux (2 of 4 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/mroute.h +8 −1
  2. include/uapi/linux/mroute6.h +8 −1
include/uapi/linux/mroute.h+8−1
@@ -28,12 +28,19 @@ · 27 unmodified lines
28#define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */28#define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */
29#define MRT_ADD_MFC_PROXY (MRT_BASE+10) /* Add a (*,*|G) mfc entry */29#define MRT_ADD_MFC_PROXY (MRT_BASE+10) /* Add a (*,*|G) mfc entry */
30#define MRT_DEL_MFC_PROXY (MRT_BASE+11) /* Del a (*,*|G) mfc entry */30#define MRT_DEL_MFC_PROXY (MRT_BASE+11) /* Del a (*,*|G) mfc entry */
31#define MRT_MAX (MRT_BASE+11)31#define MRT_FLUSH (MRT_BASE+12) /* Flush all mfc entries and/or vifs */
32#define MRT_MAX (MRT_BASE+12)
32 33
33#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */34#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */
34#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)35#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
35#define SIOCGETRPF (SIOCPROTOPRIVATE+2)36#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
36 37
38/* MRT_FLUSH optional flags */
39#define MRT_FLUSH_MFC 1 /* Flush multicast entries */
40#define MRT_FLUSH_MFC_STATIC 2 /* Flush static multicast entries */
41#define MRT_FLUSH_VIFS 4 /* Flush multicast vifs */
42#define MRT_FLUSH_VIFS_STATIC 8 /* Flush static multicast vifs */
43
37#define MAXVIFS 3244#define MAXVIFS 32
38typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */45typedef unsigned long vifbitmap_t; /* User mode code depends on this lot */
39typedef unsigned short vifi_t;46typedef unsigned short vifi_t;
include/uapi/linux/mroute6.h+8−1
@@ -31,12 +31,19 @@ · 30 unmodified lines
31#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */31#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */
32#define MRT6_ADD_MFC_PROXY (MRT6_BASE+10) /* Add a (*,*|G) mfc entry */32#define MRT6_ADD_MFC_PROXY (MRT6_BASE+10) /* Add a (*,*|G) mfc entry */
33#define MRT6_DEL_MFC_PROXY (MRT6_BASE+11) /* Del a (*,*|G) mfc entry */33#define MRT6_DEL_MFC_PROXY (MRT6_BASE+11) /* Del a (*,*|G) mfc entry */
34#define MRT6_MAX (MRT6_BASE+11)34#define MRT6_FLUSH (MRT6_BASE+12) /* Flush all mfc entries and/or vifs */
35#define MRT6_MAX (MRT6_BASE+12)
35 36
36#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */37#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
37#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)38#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
38#define SIOCGETRPF (SIOCPROTOPRIVATE+2)39#define SIOCGETRPF (SIOCPROTOPRIVATE+2)
39 40
41/* MRT6_FLUSH optional flags */
42#define MRT6_FLUSH_MFC 1 /* Flush multicast entries */
43#define MRT6_FLUSH_MFC_STATIC 2 /* Flush static multicast entries */
44#define MRT6_FLUSH_MIFS 4 /* Flushing multicast vifs */
45#define MRT6_FLUSH_MIFS_STATIC 8 /* Flush static multicast vifs */
46
40#define MAXMIFS 3247#define MAXMIFS 32
41typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */48typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */
42typedef unsigned short mifi_t;49typedef unsigned short mifi_t;