aboutsummaryrefslogtreecommitdiff
path: root/mcping.c
diff options
context:
space:
mode:
authorPlex <thinkplex@riseup.net>2022-06-15 17:22:59 +0200
committerPlex <thinkplex@riseup.net>2022-06-15 17:22:59 +0200
commit72627d2f6efe3f3297ce466a1fdd208015a19f88 (patch)
treed73c889a721dd31bc1a31f9532d542279026a665 /mcping.c
parent28b41ee492805971632e1d65ab9f855ce837767b (diff)
mcqueryHEADmaster
Diffstat (limited to 'mcping.c')
-rw-r--r--mcping.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mcping.c b/mcping.c
index 037dcc5..cc43e73 100644
--- a/mcping.c
+++ b/mcping.c
@@ -1,3 +1,4 @@
+#include <netinet/in.h>
#include <string.h>
#include <getopt.h>
#include <stdlib.h>
@@ -55,9 +56,9 @@ int main(int argc, char *argv[])
if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0)
perror("bad socket\n");
- connect_mc_server_ping(s, address, port);
- send_handshake(s, protocol_ver, address, port, 1);
- send_packet(s, 0x0, 0, NULL); // request packet (0x0 with no fields)
+ connect_mc_server(s, address, port, PING);
+ send_ping_handshake(s, protocol_ver, address, port, 1);
+ send_ping_packet(s, 0x0, 0, NULL); // request packet (0x0 with no fields)
packet response = recv_packet(s);
#ifdef _DEBUG