~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to agent/mibgroup/if-mib/data_access/interface_ioctl.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-12-08 14:59:50 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071208145950-u1tykhpw56nyzqik
Tags: 5.4.1~dfsg-4ubuntu1
* Merge from debian unstable.
* Remaining Ubuntu changes:
  - Remove stop links from rc0 and rc6
  - Munge Maintainer field as per spec.
* Ubuntu changes dropped:
  - Symlink common files between the packages, CDBS ought to handle that
    for us automatically.
* The latest Debian changes has dropped history from the changelog. Slot in
  the Ubuntu changes as best I can. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  Interface MIB architecture support
3
3
 *
4
 
 * $Id: interface_ioctl.c,v 1.12.2.1 2006/01/25 16:26:38 dts12 Exp $
 
4
 * $Id: interface_ioctl.c 15638 2006-12-06 14:34:11Z rstory $
5
5
 */
6
6
#include <net-snmp/net-snmp-config.h>
7
7
#include <net-snmp/net-snmp-includes.h>
259
259
            ifentry->admin_status = IFADMINSTATUS_DOWN;
260
260
            ifentry->oper_status = IFOPERSTATUS_DOWN;
261
261
        }
 
262
 
 
263
        /*
 
264
         * ifConnectorPresent description:
 
265
         *   This object has the value 'true(1)' if the interface sublayer has a
 
266
         *   physical connector and the value 'false(2)' otherwise."
 
267
         * So, at very least, false(2) should be returned for loopback devices.
 
268
         */
 
269
        if(ifentry->os_flags & IFF_LOOPBACK) {
 
270
            ifentry->connector_present = 0;
 
271
        }
 
272
        else {  
 
273
            ifentry->connector_present = 1;
 
274
        }
262
275
    }
263
276
    
264
277
    return rc;
386
399
    struct ifreq    ifrq;
387
400
    int rc = 0;
388
401
 
389
 
    DEBUGMSGTL(("access:interface:ioctl", "mtu_get\n"));
 
402
    DEBUGMSGTL(("access:interface:ioctl", "ifindex_get\n"));
390
403
 
391
404
    rc = _ioctl_get(fd, SIOCGIFINDEX, &ifrq, name);
392
 
    if (rc < 0)
 
405
    if (rc < 0) {
 
406
        DEBUGMSGTL(("access:interface:ioctl",
 
407
                   "ifindex_get error on inerface '%s'\n", name));
393
408
        return 0;
 
409
    }
394
410
 
395
411
    return ifrq.ifr_ifindex;
396
412
#endif /* SIOCGIFINDEX */