<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[standard ping funktion]]></title><description><![CDATA[<p>Hallo,</p>
<p>wollte ein Programm schreiben in dem ich den ping Befehl verwende.<br />
Nur wollte ich es so schreiben, dass es sowohl unter Linux als auch unter Windows läuft.</p>
<p>Welche Bibliotheken muss ich dafür benutzen?<br />
Wie heisst die Funktion?<br />
Wie kann ich die Antwort des ping auswerten?</p>
<p>mfg Markus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/103939/standard-ping-funktion</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 15:39:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/103939.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Mar 2005 19:42:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to standard ping funktion on Mon, 14 Mar 2005 19:43:32 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wollte ein Programm schreiben in dem ich den ping Befehl verwende.<br />
Nur wollte ich es so schreiben, dass es sowohl unter Linux als auch unter Windows läuft.</p>
<p>Welche Bibliotheken muss ich dafür benutzen?<br />
Wie heisst die Funktion?<br />
Wie kann ich die Antwort des ping auswerten?</p>
<p>mfg Markus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/744576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/744576</guid><dc:creator><![CDATA[kaiserbert]]></dc:creator><pubDate>Mon, 14 Mar 2005 19:43:32 GMT</pubDate></item><item><title><![CDATA[Reply to standard ping funktion on Mon, 14 Mar 2005 21:16:29 GMT]]></title><description><![CDATA[<p>guckst du: <a href="http://tangentsoft.net/wskfaq/examples/rawping.html" rel="nofollow">http://tangentsoft.net/wskfaq/examples/rawping.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/744634</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/744634</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Mon, 14 Mar 2005 21:16:29 GMT</pubDate></item><item><title><![CDATA[Reply to standard ping funktion on Tue, 15 Mar 2005 12:45:50 GMT]]></title><description><![CDATA[<p>Ich bezweifle, dass du Winsock unter Linux ans Laufen kriegst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/744961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/744961</guid><dc:creator><![CDATA[0xdeadbeef]]></dc:creator><pubDate>Tue, 15 Mar 2005 12:45:50 GMT</pubDate></item><item><title><![CDATA[Reply to standard ping funktion on Tue, 15 Mar 2005 13:09:55 GMT]]></title><description><![CDATA[<p>0xdeadbeef schrieb:</p>
<blockquote>
<p>Ich bezweifle, dass du Winsock unter Linux ans Laufen kriegst.</p>
</blockquote>
<p>nö, aber raw sockets gibt's da ja auch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/744991</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/744991</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Tue, 15 Mar 2005 13:09:55 GMT</pubDate></item><item><title><![CDATA[Reply to standard ping funktion on Tue, 15 Mar 2005 13:51:59 GMT]]></title><description><![CDATA[<p>Kann einer von euch den Unterschied zwischen winsock und raw-sock erklären?</p>
<p>Hier den Text den ich wahrscheinlich gut in meinem Programm einbauen könnte, nur das ich dafür<br />
#include &lt;winsock2.h&gt;<br />
includen muss gibts die Bibliothek für Linux oder was muss ich dafür nehmen?<br />
Etwa die Bibliothek &lt;rawsocket.h&gt; ???<br />
Gibt es das ?</p>
<pre><code class="language-cpp">// Set up for pinging
    SOCKET sd;
    sockaddr_in dest, source;
    if (setup_for_ping(argv[1], ttl, sd, dest) &lt; 0) {
        goto cleanup;
    }
    if (allocate_buffers(send_buf, recv_buf, packet_size) &lt; 0) {
        goto cleanup;
    }
    init_ping_packet(send_buf, packet_size, seq_no);

    // Send the ping and receive the reply
    if (send_ping(sd, dest, send_buf, packet_size) &gt;= 0) {
        while (1) {
            // Receive replies until we either get a successful read,
            // or a fatal error occurs.
            if (recv_ping(sd, source, recv_buf, MAX_PING_PACKET_SIZE) &lt;
                    0) {
                // Pull the sequence number out of the ICMP header.  If 
                // it's bad, we just complain, but otherwise we take 
                // off, because the read failed for some reason.
                unsigned short header_len = recv_buf-&gt;h_len * 4;
                ICMPHeader* icmphdr = (ICMPHeader*)
                        ((char*)recv_buf + header_len);
                if (icmphdr-&gt;seq != seq_no) {
                    cerr &lt;&lt; &quot;bad sequence number!&quot; &lt;&lt; endl;
                    continue;
                }
                else {
                    break;
                }
            }
            if (decode_reply(recv_buf, packet_size, &amp;source) != -2) {
                // Success or fatal error (as opposed to a minor error) 
                // so take off.
                break;
            }
        }
    }

cleanup:
    delete[]send_buf;
    delete[]recv_buf;
    WSACleanup();
    return 0;
}
</code></pre>
<p>Habt ihr daazu noch gute Links wo steht welche Funktionen man mit den nötigen Bibliotheken ausführen kann? Und dessen Syntax?</p>
<p>mfg Markus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/745025</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/745025</guid><dc:creator><![CDATA[kaiserbert]]></dc:creator><pubDate>Tue, 15 Mar 2005 13:51:59 GMT</pubDate></item><item><title><![CDATA[Reply to standard ping funktion on Tue, 15 Mar 2005 14:07:16 GMT]]></title><description><![CDATA[<p>guckst du hier: <a href="http://www.zotteljedi.de/doc/raw-socket-tipps.html#k9" rel="nofollow">http://www.zotteljedi.de/doc/raw-socket-tipps.html#k9</a><br />
(unter 'beispiele')</p>
]]></description><link>https://www.c-plusplus.net/forum/post/745042</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/745042</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Tue, 15 Mar 2005 14:07:16 GMT</pubDate></item></channel></rss>