Lines 42-47
Link Here
|
42 |
|
42 |
|
43 |
#include "osdep.h" |
43 |
#include "osdep.h" |
44 |
|
44 |
|
|
|
45 |
|
45 |
struct priv_fbsd { |
46 |
struct priv_fbsd { |
46 |
/* iface */ |
47 |
/* iface */ |
47 |
int pf_fd; |
48 |
int pf_fd; |
Lines 522-527
Link Here
|
522 |
return ioctl(priv->pf_s, SIOCSIFLLADDR, ifr); |
523 |
return ioctl(priv->pf_s, SIOCSIFLLADDR, ifr); |
523 |
} |
524 |
} |
524 |
|
525 |
|
|
|
526 |
static int fbsd_set_mtu(struct wif *wi, int mtu) |
527 |
{ |
528 |
struct priv_fbsd *priv = wi_priv(wi); |
529 |
struct ifreq *ifr = &priv->pf_ifr; |
530 |
|
531 |
memset( ifr, 0, sizeof( struct ifreq ) ); |
532 |
|
533 |
strncpy( ifr->ifr_name, wi_get_ifname(wi), sizeof( ifr->ifr_name ) ); |
534 |
ifr->ifr_mtu = mtu; |
535 |
|
536 |
if( ioctl( priv->pf_s, SIOCSIFMTU, ifr ) < 0 ) |
537 |
return( -1 ); |
538 |
|
539 |
return 0; |
540 |
} |
541 |
|
542 |
static int fbsd_get_mtu(struct wif *wi) |
543 |
{ |
544 |
struct priv_fbsd *priv = wi_priv(wi); |
545 |
struct ifreq ifr; |
546 |
|
547 |
memset( &ifr, 0, sizeof( struct ifreq ) ); |
548 |
|
549 |
ifr.ifr_addr.sa_family = AF_INET; |
550 |
|
551 |
strncpy( ifr.ifr_name, wi_get_ifname(wi), sizeof( ifr.ifr_name ) ); |
552 |
|
553 |
if( ioctl( priv->pf_s, SIOCGIFMTU, (caddr_t)&ifr ) < 0 ) |
554 |
return( -1 ); |
555 |
|
556 |
return ifr.ifr_mtu; |
557 |
} |
558 |
|
525 |
static struct wif *fbsd_open(char *iface) |
559 |
static struct wif *fbsd_open(char *iface) |
526 |
{ |
560 |
{ |
527 |
struct wif *wi; |
561 |
struct wif *wi; |
Lines 542-548
Link Here
|
542 |
wi->wi_set_mac = fbsd_set_mac; |
576 |
wi->wi_set_mac = fbsd_set_mac; |
543 |
wi->wi_get_rate = fbsd_get_rate; |
577 |
wi->wi_get_rate = fbsd_get_rate; |
544 |
wi->wi_set_rate = fbsd_set_rate; |
578 |
wi->wi_set_rate = fbsd_set_rate; |
545 |
wi->wi_get_monitor = fbsd_get_monitor; |
579 |
wi->wi_get_monitor = fbsd_get_monitor; |
|
|
580 |
wi->wi_get_mtu = fbsd_get_mtu; |
581 |
wi->wi_set_mtu = fbsd_set_mtu; |
546 |
|
582 |
|
547 |
/* setup iface */ |
583 |
/* setup iface */ |
548 |
fd = do_fbsd_open(wi, iface); |
584 |
fd = do_fbsd_open(wi, iface); |