Created
June 9, 2020 06:09
-
-
Save TIS-Edgar/9c5e94bfea40a9d0524c24e33d2678f9 to your computer and use it in GitHub Desktop.
Aravis Port Knock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/arvgvstream.c b/src/arvgvstream.c | |
index 4dde0b2..ae032c7 100644 | |
--- a/src/arvgvstream.c | |
+++ b/src/arvgvstream.c | |
@@ -41,12 +41,12 @@ | |
#include <stdio.h> | |
#include <errno.h> | |
#include <arvwakeupprivate.h> | |
+#include <netinet/in.h> | |
#ifdef ARAVIS_BUILD_PACKET_SOCKET | |
#include <ifaddrs.h> | |
#include <net/if.h> | |
-#include <netinet/in.h> | |
#include <linux/if_packet.h> | |
#include <linux/if_ether.h> | |
#include <linux/ip.h> | |
@@ -730,6 +730,17 @@ _loop (ArvGvStreamThreadData *thread_data) | |
arv_debug_stream ("[GvStream::loop] Standard socket method"); | |
+ // tell the (potential) router to open up the port for the stream data | |
+ | |
+ struct sockaddr_in dest_addr = {}; | |
+ dest_addr.sin_family = AF_INET; | |
+ const guint8 *bytes = g_inet_address_to_bytes (thread_data->device_address); | |
+ dest_addr.sin_addr.s_addr = (*((guint32 *) bytes)); | |
+ dest_addr.sin_port = htons(3957); | |
+ sendto( g_socket_get_fd (thread_data->socket), "bla", 4, 0, &dest_addr, sizeof(dest_addr)); | |
+ | |
+ // end port request | |
+ | |
poll_fd[0].fd = g_socket_get_fd (thread_data->socket); | |
poll_fd[0].events = G_IO_IN; | |
poll_fd[0].revents = 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment