rikonaka / pistol-rs

A Rust Library about Cybersecurity and Nmap
Apache License 2.0
73 stars 8 forks source link

Compile issue on windows 11 #3

Closed Rickyc81 closed 6 months ago

Rickyc81 commented 6 months ago

Hi.. I can't compile my code on Windows, but it compiles on Linux.. On Windows 11 the following error, where am I wrong?

Thanks Ric

C:\Users\ricca\Documents\GitHub\pistol_scanner_demo>cargo run -q
error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\ping\icmp.rs:43:25
   |
43 |         match icmp_iter.next_with_timeout(timeout) {
   |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\ping\icmp6.rs:43:25
   |
43 |         match icmp_iter.next_with_timeout(timeout) {
   |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Ipv4TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\ip.rs:182:20
    |
182 |         match iter.next_with_timeout(timeout) {
    |                    ^^^^^^^^^^^^^^^^^ method not found in `Ipv4TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Ipv4TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\ip.rs:194:25
    |
194 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Ipv4TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:99:24
   |
99 |         match tcp_iter.next_with_timeout(timeout) {
   |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:121:25
    |
121 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:187:24
    |
187 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:209:25
    |
209 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:275:24
    |
275 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:294:25
    |
294 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:360:24
    |
360 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:383:25
    |
383 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:449:24
    |
449 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:472:25
    |
472 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:538:24
    |
538 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:562:25
    |
562 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:628:24
    |
628 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:651:25
    |
651 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Ipv4TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:759:24
    |
759 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `Ipv4TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Ipv4TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:794:25
    |
794 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Ipv4TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Ipv4TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:843:24
    |
843 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `Ipv4TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Ipv4TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp.rs:877:25
    |
877 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Ipv4TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:64:24
   |
64 |         match tcp_iter.next_with_timeout(timeout) {
   |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:86:25
   |
86 |         match icmp_iter.next_with_timeout(timeout) {
   |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:149:24
    |
149 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:171:25
    |
171 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:234:24
    |
234 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:253:25
    |
253 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:316:24
    |
316 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:339:25
    |
339 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:402:24
    |
402 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:425:25
    |
425 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:488:24
    |
488 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:512:25
    |
512 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `TcpTransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:575:24
    |
575 |         match tcp_iter.next_with_timeout(timeout) {
    |                        ^^^^^^^^^^^^^^^^^ method not found in `TcpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
   --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\tcp6.rs:598:25
    |
598 |         match icmp_iter.next_with_timeout(timeout) {
    |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `UdpTransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\udp.rs:44:24
   |
44 |         match udp_iter.next_with_timeout(timeout) {
   |                        ^^^^^^^^^^^^^^^^^ method not found in `UdpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `IcmpTransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\udp.rs:60:25
   |
60 |         match icmp_iter.next_with_timeout(timeout) {
   |                         ^^^^^^^^^^^^^^^^^ method not found in `IcmpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `UdpTransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\udp6.rs:44:24
   |
44 |         match udp_iter.next_with_timeout(timeout) {
   |                        ^^^^^^^^^^^^^^^^^ method not found in `UdpTransportChannelIterator<'_>`

error[E0599]: no method named `next_with_timeout` found for struct `Icmpv6TransportChannelIterator` in the current scope
  --> C:\Users\ricca\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pistol-0.1.7\src\scan\udp6.rs:60:25
   |
60 |         match icmp_iter.next_with_timeout(timeout) {
   |                         ^^^^^^^^^^^^^^^^^ method not found in `Icmpv6TransportChannelIterator<'_>`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `pistol` (lib) due to 40 previous errors

C:\Users\ricca\Documents\GitHub\pistol_scanner_demo>
rikonaka commented 6 months ago

Hi @Rickyc81 , this problem should be caused by upstream libpnet https://github.com/libpnet/libpnet/issues/563, based on what it shows, it appears that this issue remains unresolved. 😥

Oh, I forgot to mention that I dropped the use of these next_with_timeout functions in the dev version (https://github.com/rikonaka/pistol-rs/tree/dev) and reimplemented them based on the data link layer, but since there are still some bugs in the part about service probing, I can't merge this version into the main mainline for now. I will merge it as soon as possible. 🤣

But you can rest assured that these problems won't occur in future releases. 😛

Rickyc81 commented 6 months ago

Thank you for your contribution! Immediately after entering the issue i also verified that the problem was in pnet, without a resolution.. I'll try to use the dev version for now.. :) I'll let you know..