* sven falempin <[email protected]> [2012-06-28 23:53]:
> Doc :
>
> <<ifconfig bridge0 rule pass in on fxp0 src 0:de:ad:be:ef:0 tag USER1>>
> Want to do something like
> <<ifconfig bridge0 rule pass in on fxp0 src 0:de:ad:*:*:* tag
> OPENBSDAWESOME>>
> or
> <<ifconfig bridge0 rule pass in on fxp0 src /\\A00:de:ad:/ tag
> OPENBSDAWESOME>>
>
> Read Code :
> found, in if_bridge.c (following SIOCBRDGARL from ifconfig)
> <<
> bcopy(&req->ifbr_src, &n->brl_src, sizeof(struct ether_addr));
> bcopy(&req->ifbr_dst, &n->brl_dst, sizeof(struct ether_addr));
> >>
>
> Search for usage of the (documented) field
> <<
> find /usr/src/ -type f | xargs grep ifbr_src
> /usr/src/share/man/man4/bridge.4: struct ether_addr ifbr_src; /* source mac
> */
> /usr/src/sbin/ifconfig/brconfig.c: printf(" src %s",
> ether_ntoa(&r->ifbr_src));
> /usr/src/sbin/ifconfig/brconfig.c: dea = &rule.ifbr_src;
> >>
>
> Now I'm lost
now it's very unclear what your actual problem is - the struct is
called ifbreq and used in a number of places, most notably of course
the ioctls.
sys/net/if_bridge.h:43:struct ifbreq {
sys/net/if_bridge.h:110: struct ifbreq *ifbicu_req;
sys/sys/sockio.h:96:#define SIOCBRDGADD _IOW('i', 60, struct ifbreq)
/* add bridge ifs */
sys/sys/sockio.h:97:#define SIOCBRDGGSIFS _IOWR('i', 60, struct ifbreq)
/* get span ifs */
sys/sys/sockio.h:98:#define SIOCBRDGDEL _IOW('i', 61, struct ifbreq)
/* del bridge ifs */
sys/sys/sockio.h:99:#define SIOCBRDGGIFFLGS _IOWR('i', 62, struct ifbreq)
/* get brdg if flags */
sys/sys/sockio.h:100:#define SIOCBRDGSIFFLGS _IOW('i', 63, struct ifbreq)
/* set brdg if flags */
sys/sys/sockio.h:103:#define SIOCBRDGADDS _IOW('i', 65, struct ifbreq)
/* add span port */
sys/sys/sockio.h:104:#define SIOCBRDGIFS _IOWR('i', 66, struct ifbreq)
/* get member ifs */
sys/sys/sockio.h:105:#define SIOCBRDGDELS _IOW('i', 66, struct ifbreq)
/* del span port */
sys/sys/sockio.h:111:#define SIOCBRDGFLUSH _IOW('i', 72, struct ifbreq)
/* flush addr cache */
sys/sys/sockio.h:124:#define SIOCBRDGSIFPRIO _IOW('i', 84, struct ifbreq)
/* set if priority */
sys/sys/sockio.h:125:#define SIOCBRDGSIFCOST _IOW('i', 85, struct ifbreq)
/* set if cost */
sys/net/bridgestp.c:2126: struct ifbreq *ifbr = (struct ifbreq *)data;
sys/net/if_bridge.c:291: struct ifbreq *req = (struct ifbreq *)data;
sys/net/if_bridge.c:789: struct ifbreq *breq = NULL;
sys/net/if_bridge.c:802: if ((breq = (struct ifbreq *)
the actual filtering is in sys/net/if_bridge.c, bridge_filterrule().
--
Henning Brauer, [email protected], [email protected]
BS Web Services, http://bsws.de, Full-Service ISP
Secure Hosting, Mail and DNS Services. Dedicated Servers, Root to Fully Managed
Henning Brauer Consulting, http://henningbrauer.com/