From ad64716013815520820e765ac257933b74dcf83e Mon Sep 17 00:00:00 2001 From: emanuele-f Date: Sun, 4 Jul 2021 15:44:48 +0200 Subject: [PATCH] Rename some fields --- app/src/main/jni/vpnproxy-jni/pcap_utils.h | 4 ++-- app/src/main/jni/vpnproxy-jni/vpnproxy.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/jni/vpnproxy-jni/pcap_utils.h b/app/src/main/jni/vpnproxy-jni/pcap_utils.h index 130e8ade..b7055d29 100644 --- a/app/src/main/jni/vpnproxy-jni/pcap_utils.h +++ b/app/src/main/jni/vpnproxy-jni/pcap_utils.h @@ -40,7 +40,7 @@ typedef struct pcaprec_hdr_s { uint32_t orig_len; } __packed pcaprec_hdr_s; -#define CUSTOM_PCAP_MAGIC 0x01072021 +#define PCAPDROID_TRAILER_MAGIC 0x01072021 /* A trailer to the packet which contains PCAPdroid-specific information. * When pcapdroid_trailer is set, the raw packet will be prepended with a bogus ethernet header, @@ -52,7 +52,7 @@ typedef struct pcaprec_hdr_s { */ typedef struct pcapdroid_trailer { uint32_t magic; - uint32_t uid; + int32_t uid; char appname[20]; uint32_t fcs; } __packed pcapdroid_trailer_t; diff --git a/app/src/main/jni/vpnproxy-jni/vpnproxy.c b/app/src/main/jni/vpnproxy-jni/vpnproxy.c index 32f23b33..9d731f07 100644 --- a/app/src/main/jni/vpnproxy-jni/vpnproxy.c +++ b/app/src/main/jni/vpnproxy-jni/vpnproxy.c @@ -916,7 +916,7 @@ static void log_callback(int lvl, const char *line) { void fill_custom_data(struct pcapdroid_trailer *cdata, vpnproxy_data_t *proxy, conn_data_t *conn) { memset(cdata, 0, sizeof(*cdata)); - cdata->magic = htonl(CUSTOM_PCAP_MAGIC); + cdata->magic = htonl(PCAPDROID_TRAILER_MAGIC); cdata->uid = htonl(conn->uid); get_appname_by_uid(proxy, conn->uid, cdata->appname, sizeof(cdata->appname)); }