473,756 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ping in c as nonroot

hello,

is out there any tutorial for writting a c/cpp program,
that can ping an other computer WITHOUT having suid state.

for the moment i only get working raw socket as root.

many thanx
ppl
Nov 14 '05 #1
4 2990
Philipp Plaenitz <pp*@janus.hrz. tu-chemnitz.de> scribbled the following:
hello, is out there any tutorial for writting a c/cpp program,
that can ping an other computer WITHOUT having suid state. for the moment i only get working raw socket as root.


The ISO standard C language does not define "ping", "suid state", "raw
sockets" or "root". In fact it does not even define "other computers".
Please ask in comp.unix.progr ammer.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"War! Huh! Good God, y'all! What is it good for? We asked Mayor Quimby."
- Kent Brockman
Nov 14 '05 #2
Philipp Plaenitz wrote:
is out there any tutorial for writting a c/cpp program,
that can ping an other computer WITHOUT having suid state.

for the moment i only get working raw socket as root.


So the answer is : The isn't.

Igmar
Nov 14 '05 #3
Igmar Palsenberg <ig***@non-existant.local> wrote:
Philipp Plaenitz wrote:
is out there any tutorial for writting a c/cpp program,
that can ping an other computer WITHOUT having suid state.

for the moment i only get working raw socket as root.
So the answer is : The isn't.


No, not necessarily, it's just that you asked the question in the
wrong newgroup. Most people usually don't admit to knowing any-
thing here about C++, networking or what "suid state" or root
accounts are since the topic of this group is the C programming
language which does not have any build-in support for networking
or must be used on an OS were "suid state" or root accounts are
available. And for C++ there's another group. Sorry.

You probably should try comp.unix.progr ammer if the "suid state"
and root account bits aren't misleading me (but I guess I don't
really have to tell you about that group since you have already
posted there).
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@p hysik.fu-berlin.de
\______________ ____________ http://www.toerring.de
Nov 14 '05 #4
Philipp Plaenitz wrote:
hello,

is out there any tutorial for writting a c/cpp program,
that can ping an other computer WITHOUT having suid state.

for the moment i only get working raw socket as root.


See http://www.planet-lab.org/raw_sockets/api.html, if you can live with
the limitations. There not true raw sockets, but better as nothing.

Igmar
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2267
by: Jason Rodman | last post by:
I have downloaded every example on how to create a ping utility in .Net in both VB and C#, but have been disappointed with the results. I have YET to find an example that returns consistent results that are even close the the actual ping command line utility. For example: If i would ping the same server over and over, some pings would come back in 0 milliseconds, others would come back in 15, but never in between. It would always jump...
9
15308
by: Mantorok | last post by:
Hi all I want to ping an ipaddress/host to check for a response. Is there any easy way in C#/.Net to do this? Thanks Kev
0
7782
by: Ed | last post by:
I've attached some VB.NET code I've hacked together (some taken from MS examples & newsgroup postings) that will perform a ping or IcmpSendEcho using the icmp.dll (see this for more info: http://support.microsoft.com/default.aspx?scid=kb;en-us;170591 ). The problem I have is in order to perform a discovery/ping of an entire subnet (192.168.1.* for instance) I have to do a FOR loop to itterate through all of the addresses. That it seems...
0
1497
by: scotty | last post by:
I need to do a ping scan of a subnet. I can Enum through the IPs and do this, but it takes over 5 minutes as I can only create 1 process at a time. Does anyone know how I can create multiple Ping Processes so as to send out 255 pings at once? (sort of a reverse ping flood). FYI: using the " -n 1" switch with Ping will cause it to only send 1 ping. Basicly the code is:
21
30531
by: Neel | last post by:
I am trying to "ping" a remote host in my C++/Redhat Linux code to check whether that host is connected or not. if (0 == system("ping -w 2 192.168.0.2)) But, in both cases (connected/disconnected), system call returns 0. Can someone please show what I am doing wrong? How to check the actual result of the ping status using C++ on Redhat linux ? Thanks in advance.
5
5587
by: Deepak | last post by:
I am programing a ping application which pings various centers . I used timer loop and it pings one by one. Now when i finish pinging one center it should wait for the ping_completed function to be executed and then continue pinging another certer. The ping_completed function is called on completion of ping by the os and i have no control on it .
1
18508
by: Krish | last post by:
All, I have an offline application that works online for some data syncronization. For data syncronization I access a webservice. I want to show whether my application is online or not by checking whether the application is able to access the webservice. If the webservice is accessible, the application is online. otherwise it is offline What is the best way to ping a url in C# ?
3
8370
by: imughal | last post by:
I got the perl script which does following task. This solution reads in a line from a text file that is passed in as input parameter 1 to a Perl script. This script will then ping the machine using TCP pings to the remote hosts echo port and will return up/down and the ping response time. A second optional attribute may be passed in that will set the default timeout for the ping response. Text file format: 127.0.0.0 localhost...
6
3459
by: Dave Marden | last post by:
I currently use this routine in vbscript to ping computers and get the status of ping to determine whether to try to backup a machine, I am trying to change it to work with vb2003.net I am wondering if anyone has a ping function they could share with me. I have done some searching on this but cannot find anything specifically for vb2003. Sub PingComputer If PingStatus(PCName) = "Success" Then
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.