Skip to content

Commit

Permalink
Fix DTLS logger (#205)
Browse files Browse the repository at this point in the history
* Unexport dialer

* Deprecate decoy dialer

* Split client transport interface

* Add functions to interface

* Remove delay from registrars

* Add client side transport

* Add transport to defaultTransport, fix client

* Type alias instead of definition

* Fix more type alias

* Add station side transport

* Sync gotapdance

* Fix lint

* Split client listen and dial

* Add debug print

* Revert "Add debug print"

This reverts commit f5a162d.

* Fix err check

* Increase heartbeat interval, rm print

* Add SkipVerifyHello option

skip hello verify when acting as server

* Add connecting stats interface

* Add connecting stats to regmanager

* Add stats during handle connecting tp reg

* Rename

* Add discard

* Implement connecting stats

* Decrement stats

* Add string, reset

* Add connectingstats to regconfig

* Load atomic

* Print counts in stats

* Fix comment

* Dbg increase verbose

* Rename vars

* Change back verbose

* Log unreg dtls part

* Increase timeout

* Revert "Increase timeout"

This reverts commit 909f7e6.

* Implement custom listener

* Add no registration num

* Add examples

* Add other failed state

* Rm discard state

* Rm more, add end state percentage

* Rename timeout, check error

* Print total end states

* Split success states for connecting transport

* Update client dep

* Fix logger

* Rm print
  • Loading branch information
mingyech authored Jul 26, 2023
1 parent 0acef79 commit 8dfa841
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions pkg/transports/connecting/dtls/dnat.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,15 @@ func newDNAT() (*dnat, error) {
flags := IFF_TUN | IFF_NO_PI
binary.LittleEndian.PutUint16(ifreq[0x10:], uint16(flags))

fmt.Printf("fd: %v\n", tun.Fd())
_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, tun.Fd(), uintptr(TUNSETIFF), uintptr(unsafe.Pointer(&ifreq[0])))
if errno != 0 {
tun.Close()
return nil, errno
}
fmt.Printf("fd after tun: %v\n", tun.Fd())

// Get the interface name
name := string(ifreq[:bytes.IndexByte(ifreq[:], 0)])

fmt.Println("Interface Name:", name)

// Bring the interface up
err = setUp(tun, name)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/transports/connecting/dtls/dtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const listenPort = 41245
type Transport struct {
dnat *dnat
dtlsListener *dtls.Listener
unregLogger func(*net.IP)
logDialSuccess func(*net.IP)
logListenSuccess func(*net.IP)
}
Expand Down Expand Up @@ -56,9 +55,10 @@ func NewTransport(logAuthFail func(*net.IP), logOtherFail func(*net.IP), logDial
}

return &Transport{
dnat: dnat,
dtlsListener: listener,
unregLogger: logAuthFail,
dnat: dnat,
dtlsListener: listener,
logDialSuccess: logDialSuccess,
logListenSuccess: logListenSuccess,
}, nil
}

Expand Down

0 comments on commit 8dfa841

Please sign in to comment.