<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 5, 2016 at 3:56 AM, Mark Pizzolato - Winpcap-Users <span dir="ltr"><<a href="mailto:winpcap-users-20040408@subscriptions.pizzolato.net" target="_blank">winpcap-users-20040408@subscriptions.pizzolato.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The inverted call model might be useful in an abstract way to get notified of a media <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">state change, however, the question then comes back to how to convey that detail <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">to the application which is using the libpcap APIs. <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Since the only APIs that an application which already has a pcap session opened <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">is using are: pcap_next_ex, pcap_dispatch, pcap_loop and possibly <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">pcap_sendpacket<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">pcap_next_ex, pcap_dispatch and pcap_loop are defined to return -1 on an error. <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Is media state change an error?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> Is media offline an error?</span></p></div></div></blockquote><div><br></div><div>I prefer to use the phrases in ncpa.cpl.</div><div>If the adapter disconnects (like Wi-Fi), libpcap API should only report time-out (you don't get any new packets).</div><div>If the adapter is disabled, libpcap API may report error (or time-out)? I didn't try this. One thing for sure is that you can't get new packets too. This thing should not happen when using Npcap/WinPcap. Because when listing adapters with Npcap/WinPcap, disabled adapters never show up on the list. So Npcap/WinPcap assumes that the adapters it uses is always kept as enabled.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">pcap_sendpacket is defined to return -1 if a packet wasn’t successfully sent.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> It would seem that returning -1 when the media is offline makes sense</span></p></div></div></blockquote><div><br></div><div>This makes sense to me.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I don’t know for sure how WinPcap behaves under these conditions, but it <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">seems that it npcap should reliably report errors under the media offline state.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Is there a reason it can’t?</span></p></div></div></blockquote><div><br></div><div>Npcap actually doesn't report errors any better than WinPcap. There's even a chance that Npcap behaves different on reporting errors with WinPcap. Because Npcap uses NDIS6 and WinPcap uses NDIS5.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p><p class="MsoNormal"><a name="-1382340311__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></a></p><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt"><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:winpcap-users-bounces@winpcap.org" target="_blank">winpcap-users-bounces@winpcap.org</a> [mailto:<a href="mailto:winpcap-users-bounces@winpcap.org" target="_blank">winpcap-users-bounces@winpcap.org</a>] <b>On Behalf Of </b>Jiyang Hu<br><b>Sent:</b> Thursday, February 4, 2016 11:18 AM<br><b>To:</b> <a href="mailto:winpcap-users@winpcap.org" target="_blank">winpcap-users@winpcap.org</a><br><b>Subject:</b> Re: [Winpcap-users] Windows 10 support for WinPcap<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><span class=""><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">@Sven: you need something called - Inverted Call Model<u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><a href="https://www.osr.com/nt-insider/2013-issue1/inverted-call-model-kmdf/" target="_blank">The Inverted Call Model in KMDF - OSR</a><br><br><u></u><u></u></span></p></div></span><div style="margin-top:3.75pt;margin-bottom:3.75pt"><table border="0" cellspacing="0" cellpadding="0" width="563" style="width:337.5pt;border-collapse:collapse"><tbody><tr style="height:.75pt"><td colspan="8" style="background:#e5e5e5;padding:0in 0in 0in 0in;height:.75pt"><div><p class="MsoNormal" style="background:#e5e5e5"><span style="font-size:1.0pt"> <u></u><u></u></span></p></div></td></tr><tr style="height:4.5pt"><td width="1" rowspan="5" style="width:.75pt;background:#e5e5e5;padding:0in 0in 0in 0in;height:4.5pt"><div><p class="MsoNormal" style="background:#e5e5e5"><span style="font-size:1.0pt"> <u></u><u></u></span></p></div></td><td width="210" rowspan="5" style="width:1.75in;background:white;padding:0in 0in 0in 0in;height:4.5pt"><p class="MsoNormal" align="center" style="text-align:center"><a href="https://www.osr.com/nt-insider/2013-issue1/inverted-call-model-kmdf/" target="_blank"><span style="border:solid windowtext 1.0pt;padding:0in;text-decoration:none"><img border="0" width="168" height="168" src="cid:image001.jpg@01D15F42.F88F5BC0" alt="Image removed by sender. image"></span></a><u></u><u></u></p></td><td width="1" rowspan="5" style="width:.75pt;background:#e5e5e5;padding:0in 0in 0in 0in;height:4.5pt"><div><p class="MsoNormal" style="background:#e5e5e5"><span style="font-size:1.0pt"> <u></u><u></u></span></p></div></td><td width="18" rowspan="5" style="width:10.5pt;background:white;padding:0in 0in 0in 0in;height:4.5pt"><div><p class="MsoNormal" style="background:white"><span style="font-size:14.0pt"> <u></u><u></u></span></p></div></td><td colspan="2" style="background:white;padding:0in 0in 0in 0in;height:4.5pt"><div><p class="MsoNormal" style="background:white"><span style="font-size:6.0pt"> <u></u><u></u></span></p></div></td><td width="25" rowspan="5" style="width:15.0pt;background:white;padding:0in 0in 0in 0in;height:4.5pt"><div><p class="MsoNormal" style="background:white"><span style="font-size:20.0pt"> <u></u><u></u></span></p></div></td><td width="1" rowspan="5" style="width:.75pt;background:#e5e5e5;padding:0in 0in 0in 0in;height:4.5pt"><div><p class="MsoNormal" style="background:#e5e5e5"><span style="font-size:1.0pt"> <u></u><u></u></span></p></div></td></tr><tr><td width="100%" colspan="2" style="width:100.0%;padding:0in 0in 0in 0in"><div><div><p class="MsoNormal" style="line-height:12.4pt;background:white;word-break:break-all"><span style="font-family:"Georgia",serif"><a href="https://www.osr.com/nt-insider/2013-issue1/inverted-call-model-kmdf/" target="_blank"><span><span style="font-size:13.5pt;color:black;text-decoration:none">The Inverted Call Model in KMDF - OSR</span></span></a><u></u><u></u></span></p><div><p class="MsoNormal" style="line-height:15.0pt;background:white;word-break:break-all"><span style="font-size:10.0pt;font-family:"Georgia",serif;color:#999999">One of the most common questions we see from students, clients, and new Windows driver Read more<u></u><u></u></span></p></div></div></div></td></tr><tr style="height:3.0pt"><td colspan="2" style="background:white;padding:0in 0in 0in 0in;height:3.0pt"></td></tr><tr><td style="padding:0in 0in 0in 0in"><div><p class="MsoNormal"><span style="font-size:1.0pt;font-family:"Arial",sans-serif"><a href="https://www.osr.com/nt-insider/2013-issue1/inverted-call-model-kmdf/" target="_blank"><span><span style="font-size:7.0pt;color:#999999;text-decoration:none">View on </span></span><span><b><span style="font-size:7.0pt;color:#999999;text-decoration:none">www.osr.com</span></b></span></a><u></u><u></u></span></p></div></td><td width="125" style="width:75.0pt;padding:0in 0in 0in 0in"><p class="MsoNormal" align="right" style="text-align:right;line-height:8.25pt"><span><span style="font-size:7.0pt;font-family:"Arial",sans-serif;color:#999999">Preview by Yahoo</span></span><span style="font-size:1.0pt;font-family:"Arial",sans-serif"><u></u><u></u></span></p></td></tr><tr style="height:6.75pt"><td colspan="2" style="background:white;padding:0in 0in 0in 0in;height:6.75pt"></td></tr><tr style="height:.75pt"><td colspan="8" style="background:#e5e5e5;padding:0in 0in 0in 0in;height:.75pt"><div><p class="MsoNormal" style="background:#e5e5e5"><span style="font-size:1.0pt"> <u></u><u></u></span></p></div></td></tr><tr height="0"><td width="1" style="border:none"></td><td width="172" style="border:none"></td><td width="1" style="border:none"></td><td width="6" style="border:none"></td><td width="188" style="border:none"></td><td width="185" style="border:none"></td><td width="8" style="border:none"></td><td width="1" style="border:none"></td></tr></tbody></table></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><div><div><span class=""><div><p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">On Thursday, February 4, 2016 12:49 PM, Sven Kerschbaum <<a href="mailto:svkers@gmail.com" target="_blank">svkers@gmail.com</a>> wrote:</span><span style="font-family:"Helvetica",sans-serif;color:black"><u></u><u></u></span></p></div><p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></span><div><div><div><span class=""><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">@Yang: It is not possible to get notifications of media state changes by the API which you proposed in your previous post. It provides only notifications about IP table changes.<u></u><u></u></span></p></div></span><div><span class=""><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">Am 04.02.2016 16:31 schrieb "Sven Kerschbaum" <<a href="mailto:svkers@gmail.com" target="_blank">svkers@gmail.com</a>>:<u></u><u></u></span></p></span><div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><span class=""><div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">Hi Yang,<u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">thanks for providing me the detailed information about Npcap. I will definitively have a look at it and try it.<u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">Cheers,<u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">SK<u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div></div></span><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p><div><span class=""><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">2016-02-04 13:04 GMT+01:00 </span><span style="font-family:"Malgun Gothic",sans-serif;color:black">食肉大灰</span><span style="font-family:"Microsoft JhengHei",sans-serif;color:black">兔</span><span style="font-family:"Helvetica",sans-serif;color:black">V5 <<a href="mailto:hsluoyz@gmail.com" target="_blank">hsluoyz@gmail.com</a>>:<u></u><u></u></span></p></span><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><span class=""><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">Hi Sven,<u></u><u></u></span></p><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">Npcap (<a href="https://github.com/nmap/npcap" target="_blank">https://github.com/nmap/npcap</a>) has better performance because of NDIS 6. It also has several new features:<u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div></span><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black">I actually didn't add a function about making user software </span><span style="font-size:9.5pt;font-family:"Helvetica",sans-serif;color:black">getting notified about media state changes. From my knowledge I don't know there's any support of such a function in libpcap. libpcap is an interface standard followed by WinPcap/Npcap. However, I think you can do it using native Windows APIs (like Receiving Notification of Network Events in <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa366334(v=vs.85).aspx" target="_blank">https://msdn.microsoft.com/en-us/library/windows/desktop/aa366334(v=vs.85).aspx</a>). And if you have any improvement advice about Npcap, I will consider it:)</span><span style="font-family:"Helvetica",sans-serif;color:black"><u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-size:9.5pt;font-family:"Helvetica",sans-serif;color:black">Cheers,</span><span style="font-family:"Helvetica",sans-serif;color:black"><u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-size:9.5pt;font-family:"Helvetica",sans-serif;color:black">Yang</span><span style="font-family:"Helvetica",sans-serif;color:black"><u></u><u></u></span></p></div></div></blockquote></div></div></blockquote></div></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><u></u> <u></u></span></p></div></div></div></div></div></div></div></div><br>_______________________________________________<br>
Winpcap-users mailing list<br>
<a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br>
<a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" rel="noreferrer" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
<br></blockquote></div><br></div></div>