If the 3Com 3C5x9 device is running, calls the el_reset_locked( )
4
routine to restart the network interface with the new address.
Calls the simple_unlock( ) routine to release the simple lock for the
5
resource that is associated with el_softc_lock.
Calls the splx( ) routine to reset the CPU priority to the level that the
6
s variable specifies.
Sets the lock_on variable to 0 (false), which indicates that the simple
7
lock is no longer held.
If an IP address was configured, broadcasts an ARP packet to notify all
8
hosts that currently have this address in their ARP tables to update
their information.
Notifies the network layer about a possible change in the af_link
9
address.
12.8 Adding the Device to a Multicast Group
(SIOCADDMULTI ioctl Command)
The following code shows how the el_ioctl( ) routine implements the
SIOCADDMULTI ioctl command to add a multicast address:
case SIOCADDMULTI:
need_reset = 0;
if (bcmp(ifr->ifr_addr.sa_data, etherbroadcastaddr, 6) == 0) {
sc->is_broadcast++;
} else {
i = lan_add_multi(&sc->is_multi,
switch (i) {
case LAN_MULTI_CHANGED:
if (sc->is_multi.lan_nmulti == 1)
need_reset++;
break;
case LAN_MULTI_NOT_CHANGED:
break;
case LAN_MULTI_FAILED:
default:
status = EINVAL;
break;
}
}
if ((ifp->if_flags & IFF_RUNNING) && (need_reset))
el_reset_locked(sc, ifp, unit);
if (sc->debug) {
j = 0;
printf("el%d: Dump of multicast table after ADD (%d entries)\n",
for (i=0; i<sc->is_multi.lan_nmulti; i++) {
unsigned char *maddr;
LAN_GET_MULTI(&sc->is_multi, maddr, j);
printf("
12–6 Implementing the ioctl Section
1
(unsigned char *)ifr->ifr_addr.sa_data);
unit, sc->is_multi.lan_nmulti);
%d
%s (muse==%d)\n", i+1,
2
3
4
Need help?
Do you have a question about the Tru64 UNIX and is the answer not in the manual?
Questions and answers