Skip to content

Commit

Permalink
try injecting dumpPackets in startPPPSession
Browse files Browse the repository at this point in the history
  • Loading branch information
skadarnold committed Jul 18, 2024
1 parent 5059e7c commit 5c5ca5b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
17 changes: 8 additions & 9 deletions ipxbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,14 @@ func makeNetwork(ctx context.Context) (network.Network, network.Network) {
// 5. ReadPacket() by server, and transmit to client.
var net network.Network
net = ipxswitch.New()
if *dumpPackets != "" {
tappableLayer := tappable.Wrap(net)
w := makePcapWriter()
sink := phys.NewPcapgoSink(w, phys.FramerEthernetII)
//go ipx.CopyPackets(ctx, tappableLayer.NewTap(), sink)
go pptp.CopyPackets(ctx, tappableLayer.NewTap(), sink)

net = tappableLayer
}
//if *dumpPackets != "" {
// tappableLayer := tappable.Wrap(net)
// w := makePcapWriter()
// sink := phys.NewPcapgoSink(w, phys.FramerEthernetII)
// go ipx.CopyPackets(ctx, tappableLayer.NewTap(), sink)
//
// net = tappableLayer
//}
if !*allowNetBIOS {
net = filter.Wrap(net)
}
Expand Down
9 changes: 9 additions & 0 deletions ppp/pptp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ func (c *Connection) startPPPSession(ctx context.Context, sendCallID uint16) {
}
node := c.s.n.NewNode()
c.ppp = ppp.NewSession(gre, node)

if *dumpPackets != "" {

Check failure on line 127 in ppp/pptp/server.go

View workflow job for this annotation

GitHub Actions / build

undefined: dumpPackets
tappableLayer := tappable.Wrap(net)

Check failure on line 128 in ppp/pptp/server.go

View workflow job for this annotation

GitHub Actions / build

undefined: tappable

Check failure on line 128 in ppp/pptp/server.go

View workflow job for this annotation

GitHub Actions / build

use of package net not in selector
w := makePcapWriter()

Check failure on line 129 in ppp/pptp/server.go

View workflow job for this annotation

GitHub Actions / build

undefined: makePcapWriter
sink := phys.NewPcapgoSink(w, phys.FramerEthernetII)

Check failure on line 130 in ppp/pptp/server.go

View workflow job for this annotation

GitHub Actions / build

undefined: phys
go ipx.CopyPackets(ctx, tappableLayer.NewTap(), sink)

Check failure on line 131 in ppp/pptp/server.go

View workflow job for this annotation

GitHub Actions / build

undefined: ipx

net = tappableLayer

Check failure on line 133 in ppp/pptp/server.go

View workflow job for this annotation

GitHub Actions / build

use of package net not in selector
}
go func() {
err := c.ppp.Run(ctx)
if err != nil {
Expand Down

0 comments on commit 5c5ca5b

Please sign in to comment.