feat: Working lease manager
This commit is contained in:
24
types.go
24
types.go
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -197,20 +196,25 @@ const (
|
||||
)
|
||||
|
||||
type LeaseState uint8
|
||||
type TxId [4]byte
|
||||
type Ipv4Addr [4]byte
|
||||
type HwAddr [16]byte
|
||||
|
||||
var magic = [4]byte{0x63, 0x82, 0x53, 0x63}
|
||||
|
||||
type DhcpMessage struct {
|
||||
Op DhcpOp
|
||||
Htype MessageType
|
||||
Hlen byte
|
||||
Hops byte
|
||||
Xid uint32
|
||||
Xid TxId
|
||||
Secs uint16
|
||||
Flags uint16
|
||||
Ciaddr uint32
|
||||
Yiaddr uint32
|
||||
Siaddr uint32
|
||||
Giaddr uint32
|
||||
Chaddr [16]byte
|
||||
Ciaddr Ipv4Addr
|
||||
Yiaddr Ipv4Addr
|
||||
Siaddr Ipv4Addr
|
||||
Giaddr Ipv4Addr
|
||||
Chaddr HwAddr
|
||||
Sname [64]byte
|
||||
File [128]byte
|
||||
Magic [4]byte
|
||||
@@ -222,9 +226,9 @@ const (
|
||||
)
|
||||
|
||||
type Lease struct {
|
||||
TransactionId uint32
|
||||
TransactionId TxId
|
||||
TTL time.Time
|
||||
State LeaseState
|
||||
ClientAddr [16]byte
|
||||
Address net.IP
|
||||
ClientAddr HwAddr
|
||||
Address Ipv4Addr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user