prep samples simplification

This commit is contained in:
Jake Hillion 2020-12-28 11:41:31 +00:00
parent e1028b8523
commit 5733789514
3 changed files with 5 additions and 25 deletions

View File

@ -1,19 +1,4 @@
#include <iostream>
#include <cstring>
#include <fcntl.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#include <zconf.h>
#include <sys/ioctl.h>
#include <thread>
#include <csignal>
#include <queue>
#include <mutex>
#include <condition_variable>
#include <sstream>
#include...
struct Packet {
size_t len;

View File

@ -8,8 +8,6 @@ import (
"syscall"
)
var PacketOverhead = 0
type Packet struct {
Data []byte
}
@ -23,7 +21,7 @@ func main() {
inboundPackets := make(chan Packet, 128)
go func() {
bufferSize := 1500 - PacketOverhead
bufferSize := 1500
buffer := make([]byte, bufferSize)
for {
@ -53,9 +51,4 @@ func main() {
}
}()
}
signals := make(chan os.Signal)
signal.Notify(signals, syscall.SIGTERM, syscall.SIGINT)
<-signals
}

4
import-code.sh Normal file → Executable file
View File

@ -6,7 +6,9 @@ rm /home/jake/repos/dissertation/4-dissertation/Preparation/Samples/* || true
rm /home/jake/repos/dissertation/4-dissertation/Implementation/Samples/* || true
# Copy code samples for preparation
cp /home/jake/repos/dissertation/1-language-tests/cpp/main.cpp /home/jake/repos/dissertation/4-dissertation/Preparation/Samples/
printf "#include...\\n" > /home/jake/repos/dissertation/4-dissertation/Preparation/Samples/main.cpp
tail -n +17 /home/jake/repos/dissertation/1-language-tests/cpp/main.cpp >> /home/jake/repos/dissertation/4-dissertation/Preparation/Samples/main.cpp
cp /home/jake/repos/dissertation/1-language-tests/go/main.go /home/jake/repos/dissertation/4-dissertation/Preparation/Samples/
cp /home/jake/repos/dissertation/1-language-tests/rust/src/main.rs /home/jake/repos/dissertation/4-dissertation/Preparation/Samples/