--- /dev/null
+/*
+ * Copyright (C) 2013 Thadeu Lima de Souza Cascardo <cascardo@cascardo.info>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+
+int main(int argc, char **argv)
+{
+ int s;
+ struct sockaddr_in sa;
+ int r;
+ if (argc < 2) {
+ fprintf(stderr, "Missing message argument.\n");
+ exit(1);
+ }
+ s = socket(PF_INET, SOCK_DGRAM, 0);
+ if (s < 0) {
+ fprintf(stderr, "Error creating socket: %s.\n", strerror(errno));
+ exit(1);
+ }
+ sa.sin_family = AF_INET;
+ sa.sin_port = htons(17078);
+ sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ r = sendto(s, argv[1], strlen(argv[1]), 0, (struct sockaddr *) &sa, sizeof(sa));
+ if (r < 0) {
+ fprintf(stderr, "Error sending message: %s\n", strerror(errno));
+ close(s);
+ exit(1);
+ }
+ close(s);
+ return 0;
+}