From: Aaron LI Date: Thu, 21 Jun 2018 00:36:00 +0000 (+0800) Subject: if_clone: Move "struct if_clonereq" over from X-Git-Tag: v5.5.0~308 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/687c518e9dcb04166a0c34c27d609eaf82d1a5e2 if_clone: Move "struct if_clonereq" over from The "if_clonereq" struct is __BSD_VISIBLE and is only used by ifconfig(8) userland tool (via searching "if_clonereq" in the dports grok), so it's safe to move it to to be clearer. --- diff --git a/sbin/ifconfig/ifclone.c b/sbin/ifconfig/ifclone.c index 93bc855b81..b98b64370d 100644 --- a/sbin/ifconfig/ifclone.c +++ b/sbin/ifconfig/ifclone.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include diff --git a/sys/net/if.h b/sys/net/if.h index ce46a88432..9cf4f12dab 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -43,8 +43,8 @@ #include #ifndef _KERNEL #include -#endif -#endif +#endif /* !_KERNEL */ +#endif /* __BSD_VISIBLE */ /* * Length of interface external name, including terminating '\0'. @@ -55,16 +55,6 @@ #define IFNAMSIZ IF_NAMESIZE #define IF_MAXUNIT 0x7fff /* if_unit is 15bits */ -/* - * Structure used to query names of interface cloners. - * XXX should be moved to net/if_clone.h - */ -struct if_clonereq { - int ifcr_total; /* total cloners (out) */ - int ifcr_count; /* room for this many in user buffer */ - char *ifcr_buffer; /* buffer for cloner names */ -}; - /* * Structure describing information about an interface * which may be of interest to management entities. diff --git a/sys/net/if_clone.h b/sys/net/if_clone.h index 8795313937..2b72a117f7 100644 --- a/sys/net/if_clone.h +++ b/sys/net/if_clone.h @@ -34,6 +34,17 @@ #ifndef _NET_IF_CLONE_H_ #define _NET_IF_CLONE_H_ +#if __BSD_VISIBLE +/* + * Structure used to query names of interface cloners. + */ +struct if_clonereq { + int ifcr_total; /* total cloners (out) */ + int ifcr_count; /* room for this many in user buffer */ + char *ifcr_buffer; /* buffer for cloner names */ +}; +#endif /* __BSD_VISIBLE */ + #ifdef _KERNEL #include @@ -62,8 +73,6 @@ struct if_clone { typedef void (*if_clone_event_handler_t)(void *, struct if_clone *); EVENTHANDLER_DECLARE(if_clone_event, if_clone_event_handler_t); -struct if_clonereq; /* XXX, should move definition from net/if.h */ - void if_clone_attach(struct if_clone *); void if_clone_detach(struct if_clone *); int if_clone_create(char *, int, caddr_t);