[Snort-users] Sniffers Misbehaviors (MS Network Monitor & tcpdump)?

Fyodor fygrave at ...121...
Wed Jan 3 04:56:20 EST 2001


oops.. my bad.. ;-}

> +    
> +    fd = socket(AF_INET, SOCK_DGRAM, 0);
> +    if ( fd < 0) {
> +        ErrorMessage("socket");

PrintError("socket");

> +        return -1;
> +    }
> +
> +    strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
> +    if (ioctl(fd, SIOCGIFMTU, &ifr) == 0)
> +        retval = ifr.ifr_metric;
> +    else
> +        ErrorMessage("ioctl(SIOCGIFMTU)");    
           PrintError("ioctl(SIOCGIFMTU)");    
> +
> +    close(fd);
> +    
> + return retval;
>  }






More information about the Snort-users mailing list