I'm looking to cull stats, programmatically, for ipnat.  I'm not sure why I
don't just call the client, but...

Here is my code excerpt:

    natstat_t natstat;
    natstat_t *natstatp = &natstat;
    int namelen, natfd;

    natfd = open(IPNAT_NAME, O_RDONLY);
    if (ioctl(natfd, SIOCGNATS, &natstatp) == -1) {
        perror("ioctl(SIOCGNATS)");
        close(natfd);
        exit(-1);
    }

Yep,  pretty straight forward.  Everytime I run it though I EINVAL (invalid
arg).  I'm running the program as root.  What might I be missing?

The relative components:

  netbsd-3 (ipfilter 4.1.8)
    ipnat=YES
    ipmon=YES
    ipfilter=YES
    ipfs=YES
    (all start fine and otherwise behaving normally)
  kernel has: 
    pseudo-device   ipfilter
    (NAT rules work, ipf rules work)
  sparc64

host> ls -asl /dev/ipnat
0 crw-------  1 root  wheel  44, 1 May  9 07:29 /dev/ipnat
host> 

Thanks,

peter

Reply via email to