Documentation
¶
Index ¶
- Constants
- func Chunks(s string, chunkSize int) []string
- func GetMessageSizeAndSender(listenAddr string) (size int, sender string)
- func IcmpSendAndWaitForReply(listeningReplyAddr string, remoteAddr string, data string) (*net.IPAddr, time.Duration, error)
- func IcmpSendRaw(listeningReplyAddr string, remoteAddr string, data string) (*net.IPAddr, error)
- func IntegrityCheck(hash string)
- func SendHashedmessage(msg string, remoteAddr string, listenAddr string)
- func SendNoReply(listeningReplyAddr string, remoteAddr string, chunkSize int, delay int, ...)
- func SendReply(listeningReplyAddr string, remoteAddr string, chunkSize int, delay int, ...)
- func SendWhileNoEchoReply(listeningReplyAddr string, remoteAddr string, data string)
- func Serve(listenAddr string, n int, progressBar bool) (data string, missingPacketIndexes []int)
- func ServeTemporary(listenAddr string, n int, progressBar bool, delay int) (data string, missingPacketIndexes []int)
Constants ¶
const (
ProtocolICMP = 1
)
Variables ¶
This section is empty.
Functions ¶
func Chunks ¶
Return a slice of a the string chunked with specific length (string length of each chunk) Thanks to https://stackoverflow.comProtocolICMP/questions/25686109/split-string-by-length-in-golang
func GetMessageSizeAndSender ¶
Wait for the fistr ICMP packet setting sized of data
func IcmpSendAndWaitForReply ¶
func IcmpSendAndWaitForReply(listeningReplyAddr string, remoteAddr string, data string) (*net.IPAddr, time.Duration, error)
Mostly based on https://github.com/golang/net/blob/master/icmp/ping_test.go Send ICMP echo request packet (code 8) to remote and waiting for the echo reply (code 0)
func IcmpSendRaw ¶
Mostly based on https://github.com/golang/net/blob/master/icmp/ping_test.go Send ICMP echo request packet (code 8) to remote and waiting for the echo reply (code 0)
func IntegrityCheck ¶
func IntegrityCheck(hash string)
Wait ICMP message from remote to assert if the message is well received
func SendHashedmessage ¶
func SendNoReply ¶
func SendNoReply(listeningReplyAddr string, remoteAddr string, chunkSize int, delay int, data string)
Send string to remote using ICMP and waiting for echo reply. You must specify the delay between each packet and the size
func SendReply ¶
Send string to remote using ICMP and waiting for echo reply. You must specify the delay between each packet and the size
func SendWhileNoEchoReply ¶
Send echo the same echo packet while we do not received an echo reply
func ServeTemporary ¶
func ServeTemporary(listenAddr string, n int, progressBar bool, delay int) (data string, missingPacketIndexes []int)
ICMP server waiting for specific number of packet (waiting n packet) but that stop working after (n+2)*delay seconds return a string with the data section of each packet concatened and the index of the packet missing
Types ¶
This section is empty.