Re: Q:How can I determine if an if is up in C/C++ only?

2000-12-15 Thread Gilad Ben-Yossef
mulix wrote: Gilad Ben-Yossef wrote: ifstat source snipped strcpy(ifr.ifr_name, argv[1]); this is broken. ifr.ifr_name is a char array of size IFNAMSIZ (which is defined to 16 in net/if.h- not a very long buffer). if the user supplies a long enough argv[1], you have your

Q:How can I determine if an if is up in C/C++ only?

2000-12-14 Thread Isaac Aaron
Hi people I have this question: How can I determine if a network interface is up in C/C++ only? I need something that will give something like what ifconfig does in C/C++. Thanks in advance Isaac Aaron = To unsubscribe, send

Re: Q:How can I determine if an if is up in C/C++ only?

2000-12-14 Thread mulix
Isaac Aaron wrote: How can I determine if a network interface is up in C/C++ only? in short, you use various ioctl calls to get the list of interfaces from the kernel and to get the flags for a specific interface, or you can parse /proc/net/dev and see if the interface you need appears there.

Re: Q:How can I determine if an if is up in C/C++ only?

2000-12-14 Thread Gilad Ben-Yossef
Isaac Aaron wrote: I have this question: How can I determine if a network interface is up in C/C++ only? Share Enjoy: /* ifstat - a small stupid utility to test net interfaces status Copyright (C) 2000 Gilad Ben-Yossef This program is free software; you can redistribute it

Re: Q:How can I determine if an if is up in C/C++ only?

2000-12-14 Thread Omer Musaev
Gilad Ben-Yossef writes: "Anything that can go wrong, will go wrong, while interrupts are disabled. " -- Murphey's law of kernel programing. Can not agree more :) (It will, I checked that :) = To unsubscribe, send

Re: Q:How can I determine if an if is up in C/C++ only?

2000-12-14 Thread mulix
Gilad Ben-Yossef wrote: ifstat source snipped strcpy(ifr.ifr_name, argv[1]); this is broken. ifr.ifr_name is a char array of size IFNAMSIZ (which is defined to 16 in net/if.h- not a very long buffer). if the user supplies a long enough argv[1], you have your classic buffer overflow here,

Re: Q:How can I determine if an if is up in C/C++ only?

2000-12-14 Thread guy keren
On Fri, 15 Dec 2000, mulix wrote: strcpy(ifr.ifr_name, argv[1]); this is broken. ifr.ifr_name is a char array of size IFNAMSIZ (which is defined to 16 in net/if.h- not a very long buffer). if the user supplies a long enough argv[1], you have your classic buffer overflow here, easily