Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Chris Morgan
    @chmorgan
    @kayoub5 ahh ok, yeah I did that on azure pipelines last night
    @kayoub5 is Codecov working as expected? I added a badge for it on a PR that I mentioned you on
    Ayoub Kaanich
    @kayoub5
    Most are working as expected, only azure is failing since the token was not configured
    Chris Morgan
    @chmorgan
    @kayoub5 let me kick of an azure pipelines build
    it should be working correctly, I did add the key
    Chris Morgan
    @chmorgan
    @kayoub5 kicked off a build, verified that the key is set
    Chris Morgan
    @chmorgan
    @kayoub5 any idea why all of the CI tests are failing now?
    Ayoub Kaanich
    @kayoub5
    They are passing...
    I was trying to increase coverage, and broke one test case in Linux, so CI failed, fixed in same branch and rebased
    @chmorgan What do you mean?
    Chris Morgan
    @chmorgan
    @kayoub5 they are passing now, not sure what changed
    Chris Morgan
    @chmorgan
    @kayoub5 any thoughts on the other pull requests from that renovate app?
    Ayoub Kaanich
    @kayoub5
    @chmorgan waiting for them to pass CI
    It's best if you review chmorgan/sharppcap#125 since it's PacketDotNet
    Chris Morgan
    @chmorgan
    @kayoub5 looks good to me!
    approved
    Malivil
    @Malivil
    Hello. Is here an appropriate place to ask for help with SharpPcap on Linux? Or should I create an issue instead?
    Summary: "Unable to load shared library 'wpcap' or one of its dependencies" running SharpPcap 5.1.0 on .Net Core 3.1.4 on Ubuntu
    Malivil
    @Malivil
    The call is in pcap_findalldevs which is routing through Npcap.SafeNativeMethods so for some reason it thinks I'm running Windows?
    Malivil
    @Malivil
    Nevermind, I figured it out. I was calling an NPcap method directly
    Ayoub Kaanich
    @kayoub5

    @chmorgan I think I found the problem(s) we have with the tests in Linux

    • When using pcap_dispatch no other pcap_* function could be called on the same handle, other than pcap_breakloop, this means we can't use the device while StartCapture is active, not even to send packets.
      See the-tcpdump-group/libpcap#400
      This problem could be resolved by using two device instances

    • The function pcap_next_ex will return 0 when timeout happens in Windows, in Linux it will block forever unless the device is set in non-blocking mode
      See https://github.com/the-tcpdump-group/libpcap/issues/572#issuecomment-640274717
      Do you have a proposition on how to normalize GetNextPackatet behavior?

    Chris Morgan
    @chmorgan
    @kayoub5 alright, I switched to GitHub actions and the nuget stuff is working better now
    couldn't figure out Appveyor from the .yml file
    Jeivardan
    @jeivardan
    Hi!!
    Is there a proper documentation for Sharppcap API's?
    Chris Morgan
    @chmorgan
    @jeivardan there is not at the moment but we'd love to have help generating docs from the code
    that's also why we provide a number of examples, to show how the api works
    Jeivardan
    @jeivardan
    Okay I'll refer to the examples!
    Jeivardan
    @jeivardan
    @chmorgan Is there a way to reassemble TCP stream using Sharppcap?
    Chris Morgan
    @chmorgan
    @jeivardan there is, see packetnet-connections
    If we dont mention it on the sharppcap page we should
    Jeivardan
    @jeivardan
    Great @chmorgan, I looked into packetnet-connectctions, So I need to use TcpConnectionManager and TcpStreamGenerator to reassemble the streams while capturing the packets
    Jeivardan
    @jeivardan
    I understand the architecture but I don't know how exactly use the lib in order to achieve the TCP streams as capturing the packets, There are examples for HTTP sessions but not for this
    Or did I miss anything
    Chris Morgan
    @chmorgan
    Yeah youll have to use the http ones and the code to see how to use it. Pull requests welcome!
    Jeivardan
    @jeivardan
    👍
    Jeivardan
    @jeivardan
    @chmorgan does packetdotnet-connections work with sharppcap version 6?
    Jeivardan
    @jeivardan
    @chmorgan When I use packetdotnet-connections v_1.2 which is the latest available in nuget which has a dependancy to packetdotnet with v_1.0.1 and sharppcap with v_6 which has a dependencency to packetdotnet v_1.2, I get some errors, so please can you update the packetdotnet and Sharpcap depency in packetdotnet-connections and release?
    Error CS0012 The type 'TcpPacket' is defined in an assembly that is not referenced. You must add a reference to assembly 'PacketDotNet, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null'
    I get the above error when I call tcpConnectionManager.ProcessPacket(e.Header.Timeval, tcpPacket)
    Jeivardan
    @jeivardan
    I cant use packetdotnet-connections with Sharppcap version 6 can only use with version 5.0
    Ali İhsan ELMAS
    @eysidisi
    hello @chmorgan Thanks for your effort creating this library
    I got one question which I posted on StackOverflow but couldn't get an answer so far
    Recently I've started building an application using SharpPcap. I want to capture all packets on the network but at the same time, I need to send packets with different source IP/MAC addresses.
    I don't want to capture the packets that I send. So, I need to discard packets that are sent from the same device as I listen to the network somehow. If there is no way of discarding the packets a way to filter those packets would also work for me
    I tried to play with DeviceModes for the device that I use for listening. But it didn't work.
    I tried to filter using the network device's IP/MAC address but since I use different IP and MAC addresses for each packet that doesn't work either.
    I tried to filter using the interface name. I found out that for interface filter the syntax is ifname interfaceName. But when I apply this filter to the network device it gives an exception saying that: "can't compile filter : libcap was compiled without pf support". I use an ethernet protocol filter and it works.
    Can you suggest a method for filtering packets that are sent by me?
    Ayoub Kaanich
    @kayoub5
    @eysidisi you can vlan tag the frames with vlan 0, normal os frames don't use vlans, and most receivers will ignore the vlan tag, using ip options could work too.
    If the no capture local flag is not working, you should open a ticket to libpcap or npcap.