Developing lightweight computation at the DSG edge

Commit 5740bb1f authored by keeZey's avatar keeZey Committed by Cameron Sparr
Browse files

Change size to Size to make it exportable (#18)

I have made Size exportable as i require the ability to change the
packetsize on a per host basis
parent 68a45b48
......@@ -93,7 +93,7 @@ func NewPinger(addr string) (*Pinger, error) {
network: "udp",
ipv4: ipv4,
size: timeSliceLength,
Size: timeSliceLength,
done: make(chan bool),
}, nil
......@@ -131,15 +131,18 @@ type Pinger struct {
// OnFinish is called when Pinger exits
OnFinish func(*Statistics)
// Size of packet being sent
Size int
// stop chan bool
done chan bool
ipaddr *net.IPAddr
addr string
ipv4 bool
source string
size int
ipv4 bool
source string
sequence int
network string
}
......@@ -466,8 +469,8 @@ func (p *Pinger) sendICMP(conn *icmp.PacketConn) error {
}
t := timeToBytes(time.Now())
if p.size-timeSliceLength != 0 {
t = append(t, byteSliceOfSize(p.size-timeSliceLength)...)
if p.Size-timeSliceLength != 0 {
t = append(t, byteSliceOfSize(p.Size-timeSliceLength)...)
}
bytes, err := (&icmp.Message{
Type: typ, Code: 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment