Lines Matching refs:sk
284 int sk, err; in tap_if_up() local
286 sk = socket(AF_INET, SOCK_DGRAM, 0); in tap_if_up()
287 if (sk < 0) return -1; in tap_if_up()
292 err = ioctl(sk, SIOCGIFHWADDR, &ifr); in tap_if_up()
297 close(sk); in tap_if_up()
318 err = ioctl(sk, SIOCSIFHWADDR, (caddr_t)&ifr); in tap_if_up()
323 close(sk); in tap_if_up()
334 err = ioctl(sk, SIOCSIFFLAGS, (caddr_t)&ifr); in tap_if_up()
339 close(sk); in tap_if_up()
342 close(sk); in tap_if_up()
349 int sk; in tap_if_down() local
351 sk = socket(AF_INET, SOCK_DGRAM, 0); in tap_if_down()
352 if (sk < 0) return -1; in tap_if_down()
359 ioctl(sk, SIOCSIFFLAGS, (caddr_t)&ifr); in tap_if_down()
361 close(sk); in tap_if_down()