Back to index

openldap  2.4.31
Classes | Defines | Functions | Variables
ether.c File Reference
#include "nssov.h"

Go to the source code of this file.

Classes

struct  ether_addr

Defines

#define WRITE_ETHER(fp, addr)

Functions

 NSSOV_CBPRIV (ether, char buf[256];struct berval name;struct berval addr;)
static int write_ether (nssov_ether_cbp *cbp, Entry *entry)
 NSSOV_HANDLE (NSSOV_HANDLE(ether, byname)
 READ_TYPE (fp, addr, uint8_t[6])
 Debug (LDAP_DEBUG_TRACE,"nssov_ether_byether(%s)\n", cbp.addr.bv_val, 0, 0)
 nssov_filter_byid (cbp.mi, 1,&cbp.addr,&filter)) NSSOV_HANDLE(ether
 Debug (LDAP_DEBUG_TRACE,"nssov_ether_all()\n", 0, 0, 0)

Variables

static struct berval = BER_BVC("(objectClass=ieee802Device)")
filter bv_val = fbuf
BER_BVZEROcbp
cbp addr bv_len
 NSLCD_ACTION_ETHER_BYETHER
 all
 NSLCD_ACTION_ETHER_ALL
 filter = cbp.mi->mi_filter

Class Documentation

struct ether_addr

Definition at line 25 of file ether.c.

Class Members
uint8_t ether_addr_octet

Define Documentation

#define WRITE_ETHER (   fp,
  addr 
)
Value:
{int ao[6]; \
  sscanf(addr.bv_val,"%02x:%02x:%02x:%02x:%02x:%02x", \
       &ao[0], &ao[1], &ao[2], &ao[3], &ao[4], &ao[5] );\
       tmpaddr.ether_addr_octet[0] = ao[0]; \
       tmpaddr.ether_addr_octet[1] = ao[1]; \
       tmpaddr.ether_addr_octet[2] = ao[2]; \
       tmpaddr.ether_addr_octet[3] = ao[3]; \
       tmpaddr.ether_addr_octet[4] = ao[4]; \
       tmpaddr.ether_addr_octet[5] = ao[5]; } \
  WRITE_TYPE(fp,tmpaddr,uint8_t[6]);

Definition at line 52 of file ether.c.


Function Documentation

Debug ( LDAP_DEBUG_TRACE  ,
"nssov_ether_byether(%s)\n ,
cbp.addr.  bv_val,
,
 
)
Debug ( LDAP_DEBUG_TRACE  ,
"nssov_ether_all()\n ,
,
,
 
)
NSSOV_CBPRIV ( ether  ,
char buf;struct berval name;struct berval addr [256] 
)
nssov_filter_byid ( cbp.  mi,
,
&cbp.  addr,
filter 
)

Here is the caller graph for this function:

NSSOV_HANDLE ( NSSOV_HANDLE ether,
byname   
)

Definition at line 123 of file ether.c.

                              {sizeof(fbuf)};
       filter.bv_val = fbuf;
       BER_BVZERO(&cbp.addr);
       READ_STRING(fp,cbp.buf);
       cbp.name.bv_len = tmpint32;
       cbp.name.bv_val = cbp.buf;,
       Debug(LDAP_DEBUG_TRACE,"nssov_ether_byname(%s)\n",cbp.name.bv_val,0,0);,
       NSLCD_ACTION_ETHER_BYNAME,
       nssov_filter_byname(cbp.mi,0,&cbp.name,&filter)
)

NSSOV_HANDLE(
       ether,byether,
       struct ether_addr addr;
       char fbuf[1024];
       struct berval filter = {sizeof(fbuf)};

Here is the call graph for this function:

READ_TYPE ( fp  ,
addr  ,
uint8_t  [6] 
)
static int write_ether ( nssov_ether_cbp *  cbp,
Entry entry 
) [static]

Definition at line 64 of file ether.c.

{
       int32_t tmpint32;
       struct ether_addr tmpaddr;
       struct berval tmparr[2], empty;
       struct berval *names,*ethers;
       Attribute *a;
       int i,j;

       /* get the name of the ether entry */
       if (BER_BVISNULL(&cbp->name))
       {
              a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[0].an_desc);
              if ( !a )
              {
                     Debug(LDAP_DEBUG_ANY,"ether entry %s does not contain %s value\n",
                                                 entry->e_name.bv_val,cbp->mi->mi_attrs[0].an_desc->ad_cname.bv_val,0 );
                     return 0;
              }
              names = a->a_vals;
       }
       else
       {
              names=tmparr;
              names[0]=cbp->name;
              BER_BVZERO(&names[1]);
       }
       /* get the addresses */
       if (BER_BVISNULL(&cbp->addr))
       {
              a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[1].an_desc);
              if ( !a )
              {
                     Debug(LDAP_DEBUG_ANY,"ether entry %s does not contain %s value\n",
                                                 entry->e_name.bv_val,cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val,0 );
                     return 0;
              }
              ethers = a->a_vals;
              /* TODO: move parsing of addresses up here */
       }
       else
       {
              ethers=tmparr;
              ethers[0]=cbp->addr;
              BER_BVZERO(&ethers[1]);
       }
       /* write entries for all names and addresses */
       for (i=0;!BER_BVISNULL(&names[i]);i++)
              for (j=0;!BER_BVISNULL(&ethers[j]);j++)
              {
                     WRITE_INT32(cbp->fp,NSLCD_RESULT_BEGIN);
                     WRITE_BERVAL(cbp->fp,&names[i]);
                     WRITE_ETHER(cbp->fp,ethers[j]);
              }
       return 0;
}

Here is the call graph for this function:


Variable Documentation

all

Definition at line 159 of file ether.c.

static struct berval = BER_BVC("(objectClass=ieee802Device)") [static]

Definition at line 36 of file ether.c.

cbp prot bv_len
Initial value:
 snprintf(cbp.buf,sizeof(cbp.buf), "%x:%x:%x:%x:%x:%x",
              addr.ether_addr_octet[0],
              addr.ether_addr_octet[1],
              addr.ether_addr_octet[2],
              addr.ether_addr_octet[3],
              addr.ether_addr_octet[4],
              addr.ether_addr_octet[5])

Definition at line 145 of file ether.c.

cbp prot bv_val = fbuf

Definition at line 142 of file ether.c.

Definition at line 143 of file ether.c.

filter = cbp.mi->mi_filter

Definition at line 166 of file ether.c.

Definition at line 164 of file ether.c.

Definition at line 153 of file ether.c.