• Home
  • Raw
  • Download

Lines Matching refs:s

16 static void die(const char *s)  in die()  argument
18 fprintf(stderr,"error: %s (%s)\n", s, strerror(errno)); in die()
22 static void setflags(int s, struct ifreq *ifr, int set, int clr) in setflags() argument
24 if(ioctl(s, SIOCGIFFLAGS, ifr) < 0) die("SIOCGIFFLAGS"); in setflags()
26 if(ioctl(s, SIOCSIFFLAGS, ifr) < 0) die("SIOCSIFFLAGS"); in setflags()
36 static void setmtu(int s, struct ifreq *ifr, const char *mtu) in setmtu() argument
40 if(ioctl(s, SIOCSIFMTU, ifr) < 0) die("SIOCSIFMTU"); in setmtu()
42 static void setdstaddr(int s, struct ifreq *ifr, const char *addr) in setdstaddr() argument
45 if(ioctl(s, SIOCSIFDSTADDR, ifr) < 0) die("SIOCSIFDSTADDR"); in setdstaddr()
48 static void setnetmask(int s, struct ifreq *ifr, const char *addr) in setnetmask() argument
51 if(ioctl(s, SIOCSIFNETMASK, ifr) < 0) die("SIOCSIFNETMASK"); in setnetmask()
54 static void setaddr(int s, struct ifreq *ifr, const char *addr) in setaddr() argument
57 if(ioctl(s, SIOCSIFADDR, ifr) < 0) die("SIOCSIFADDR"); in setaddr()
63 int s; in ifconfig_main() local
79 if((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { in ifconfig_main()
84 if (ioctl(s, SIOCGIFADDR, &ifr) < 0) { in ifconfig_main()
90 if (ioctl(s, SIOCGIFNETMASK, &ifr) < 0) { in ifconfig_main()
96 if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) { in ifconfig_main()
129 setflags(s, &ifr, IFF_UP, 0); in ifconfig_main()
136 setmtu(s, &ifr, argv[0]); in ifconfig_main()
138 setflags(s, &ifr, IFF_POINTOPOINT, 1); in ifconfig_main()
145 setdstaddr(s, &ifr, argv[0]); in ifconfig_main()
146 setflags(s, &ifr, IFF_POINTOPOINT, 0); in ifconfig_main()
148 setflags(s, &ifr, 0, IFF_UP); in ifconfig_main()
155 setnetmask(s, &ifr, argv[0]); in ifconfig_main()
157 setaddr(s, &ifr, argv[0]); in ifconfig_main()
158 setflags(s, &ifr, IFF_UP, 0); in ifconfig_main()