Added forking support, support for larger command outputs, and other improvements

This commit is contained in:
Jacob Hartman
2026-03-14 21:37:13 -04:00
parent 062ef4d24f
commit e50cf1ead0
4 changed files with 170 additions and 106 deletions

View File

@@ -16,6 +16,11 @@
*/
#ifndef WATERSHELL_H_
#define WATERSHELL_H_
#define RECV_BUFFER_SIZE 4096
#define SEND_CHUNK_SIZE (ETH_DATA_LEN - sizeof(struct udphdr) - sizeof(struct iphdr))
/* BPF code generated with tcpdump -dd udp and port 12345
* used to filter incoming packets at the socket level
*/
@@ -49,7 +54,7 @@ struct __attribute__((__packed__)) udpframe {
struct ethhdr ehdr;
struct iphdr ip;
struct udphdr udp;
unsigned char data[ETH_DATA_LEN - sizeof(struct udphdr) - sizeof(struct iphdr)];
unsigned char data[SEND_CHUNK_SIZE];
};
void send_status(unsigned char *buf, char *payload);