Compare commits
	
		
			2 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | d495ba9be7 | ||
|  | 5b194581b5 | 
							
								
								
									
										3
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								go.mod
									
									
									
									
									
								
							| @@ -5,13 +5,12 @@ go 1.23.2 | |||||||
| require ( | require ( | ||||||
| 	git.crumpington.com/lib/go v0.8.1 | 	git.crumpington.com/lib/go v0.8.1 | ||||||
| 	git.crumpington.com/lib/webutil v0.0.7 | 	git.crumpington.com/lib/webutil v0.0.7 | ||||||
| 	github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 |  | ||||||
| 	golang.org/x/crypto v0.29.0 | 	golang.org/x/crypto v0.29.0 | ||||||
|  | 	golang.org/x/sys v0.27.0 | ||||||
| ) | ) | ||||||
|  |  | ||||||
| require ( | require ( | ||||||
| 	github.com/mattn/go-sqlite3 v1.14.24 // indirect | 	github.com/mattn/go-sqlite3 v1.14.24 // indirect | ||||||
| 	golang.org/x/net v0.31.0 // indirect | 	golang.org/x/net v0.31.0 // indirect | ||||||
| 	golang.org/x/sys v0.27.0 // indirect |  | ||||||
| 	golang.org/x/text v0.20.0 // indirect | 	golang.org/x/text v0.20.0 // indirect | ||||||
| ) | ) | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.sum
									
									
									
									
									
								
							| @@ -4,8 +4,6 @@ git.crumpington.com/lib/webutil v0.0.7 h1:1RG9CpuXYalT0NPj8fvxjOLV566LqL37APvAdA | |||||||
| git.crumpington.com/lib/webutil v0.0.7/go.mod h1:efIEiuK1uqFIhI/dlsWUHMsC5bXcEbJEjmdluRoFPPQ= | git.crumpington.com/lib/webutil v0.0.7/go.mod h1:efIEiuK1uqFIhI/dlsWUHMsC5bXcEbJEjmdluRoFPPQ= | ||||||
| github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= | github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= | ||||||
| github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= | github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= | ||||||
| github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 h1:TG/diQgUe0pntT/2D9tmUCz4VNwm9MfrtPr0SU2qSX8= |  | ||||||
| github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8/go.mod h1:P5HUIBuIWKbyjl083/loAegFkfbFNx5i2qEP4CNbm7E= |  | ||||||
| golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= | golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= | ||||||
| golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= | golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= | ||||||
| golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= | golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= | ||||||
|   | |||||||
| @@ -1,7 +1,3 @@ | |||||||
| body { |  | ||||||
|     max-width: 1920px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .def-list tr td:first-child { | .def-list tr td:first-child { | ||||||
|     text-align:right; |     text-align:right; | ||||||
|     width:1%; |     width:1%; | ||||||
|   | |||||||
| @@ -3,7 +3,6 @@ | |||||||
|  |  | ||||||
| <p> | <p> | ||||||
|   <a href="/admin/peer/edit/?PeerIP={{.Peer.PeerIP}}">Edit</a> / |   <a href="/admin/peer/edit/?PeerIP={{.Peer.PeerIP}}">Edit</a> / | ||||||
|   <a href="/admin/peer/init/?PeerIP={{.Peer.PeerIP}}">Initialize</a> / |  | ||||||
|   <a href="/admin/peer/delete/?PeerIP={{.Peer.PeerIP}}">Delete</a> |   <a href="/admin/peer/delete/?PeerIP={{.Peer.PeerIP}}">Delete</a> | ||||||
| </p> | </p> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -13,23 +13,25 @@ const ( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| type header struct { | type header struct { | ||||||
|  | 	Version  byte | ||||||
| 	StreamID byte | 	StreamID byte | ||||||
| 	Counter  uint64 // Init with time.Now().Unix << 30 to ensure monotonic. |  | ||||||
| 	SourceIP byte | 	SourceIP byte | ||||||
| 	DestIP   byte | 	DestIP   byte | ||||||
|  | 	Counter  uint64 // Init with time.Now().Unix << 30 to ensure monotonic. | ||||||
| } | } | ||||||
|  |  | ||||||
| func (h *header) Parse(b []byte) { | func (h *header) Parse(b []byte) { | ||||||
| 	h.StreamID = b[0] | 	h.Version = b[0] | ||||||
| 	h.Counter = *(*uint64)(unsafe.Pointer(&b[1])) | 	h.StreamID = b[1] | ||||||
| 	h.SourceIP = b[9] | 	h.SourceIP = b[2] | ||||||
| 	h.DestIP = b[10] | 	h.DestIP = b[3] | ||||||
|  | 	h.Counter = *(*uint64)(unsafe.Pointer(&b[4])) | ||||||
| } | } | ||||||
|  |  | ||||||
| func (h *header) Marshal(buf []byte) { | func (h *header) Marshal(buf []byte) { | ||||||
| 	buf[0] = h.StreamID | 	buf[0] = h.Version | ||||||
| 	*(*uint64)(unsafe.Pointer(&buf[1])) = h.Counter | 	buf[1] = h.StreamID | ||||||
| 	buf[9] = h.SourceIP | 	buf[2] = h.SourceIP | ||||||
| 	buf[10] = h.DestIP | 	buf[3] = h.DestIP | ||||||
| 	buf[11] = 0 | 	*(*uint64)(unsafe.Pointer(&buf[4])) = h.Counter | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user