openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/nss-pam-ldapd/0.9.8-r0/nss-pam-ldapd-0.9.8/nslcd/network.c
static int write_network(TFILE* fp, MYLDAP_ENTRY* entry)
{
    int32_t tmpint32, tmp2int32, tmp3int32;
    int numaddr, i;
    const char* networkname;
    const char** networknames;
    const char** addresses;
    /* get the most canonical name */
    networkname = myldap_get_rdn_value(entry, attmap_network_cn);
    /* get the other names for the network */
    networknames = myldap_get_values(entry, attmap_network_cn);
    if ((networknames == NULL) || (networknames[0] == NULL))
    {
        log_log(LOG_WARNING, "%s: %s: missing", myldap_get_dn(entry),
                attmap_network_cn);
        return 0;
    }
    /* if the networkname is not yet found, get the first entry from
     * networknames */
    if (networkname == NULL)
        networkname = networknames[0];
    /* get the addresses */
    addresses = myldap_get_values(entry, attmap_network_ipNetworkNumber);
    if ((addresses == NULL) || (addresses[0] == NULL))
    {
        log_log(LOG_WARNING, "%s: %s: missing", myldap_get_dn(entry),
                attmap_network_ipNetworkNumber);
        return 0;
    }
    /* write the entry */
    WRITE_INT32(fp, NSLCD_RESULT_BEGIN);
    WRITE_STRING(fp, networkname);
    WRITE_STRINGLIST_EXCEPT(fp, networknames, networkname);
    for (numaddr = 0; addresses[numaddr] != NULL; numaddr++)
        /* noting */;
    WRITE_INT32(fp, numaddr);
    for (i = 0; i < numaddr; i++)
    {
        WRITE_ADDRESS(fp, entry, attmap_network_ipNetworkNumber, addresses[i]);
    }
    return 0;
}
/* write a single network entry to the stream */
write a single network entry to the stream
write a single network entry to the stream
static int write_network(TFILE* fp, MYLDAP_ENTRY* entry)
{
    int32_t tmpint32, tmp2int32, tmp3int32;
    int numaddr, i;
    const char* networkname;
    const char** networknames;
    const char** addresses;
    networkname = myldap_get_rdn_value(entry, attmap_network_cn);
    networknames = myldap_get_values(entry, attmap_network_cn);
    if ((networknames == NULL) || (networknames[0] == NULL))
    {
        log_log(LOG_WARNING, "%s: %s: missing", myldap_get_dn(entry),
                attmap_network_cn);
        return 0;
    }
    if (networkname == NULL)
        networkname = networknames[0];
    addresses = myldap_get_values(entry, attmap_network_ipNetworkNumber);
    if ((addresses == NULL) || (addresses[0] == NULL))
    {
        log_log(LOG_WARNING, "%s: %s: missing", myldap_get_dn(entry),
                attmap_network_ipNetworkNumber);
        return 0;
    }
    WRITE_INT32(fp, NSLCD_RESULT_BEGIN);
    WRITE_STRING(fp, networkname);
    WRITE_STRINGLIST_EXCEPT(fp, networknames, networkname);
    for (numaddr = 0; addresses[numaddr] != NULL; numaddr++)
        ;
    WRITE_INT32(fp, numaddr);
    for (i = 0; i < numaddr; i++)
    {
        WRITE_ADDRESS(fp, entry, attmap_network_ipNetworkNumber, addresses[i]);
    }
    return 0;
}
static int write_network ( TFILE * fp , MYLDAP_ENTRY * entry ) { int32_t tmpint32 , tmp2int32 , tmp3int32 ; int numaddr , i ; const char * networkname ; const char * * networknames ; const char * * addresses ; networkname = myldap_get_rdn_value ( entry , attmap_network_cn ) ; networknames = myldap_get_values ( entry , attmap_network_cn ) ; if ( ( networknames == NULL ) || ( networknames [ 0 ] == NULL ) ) { log_log ( LOG_WARNING , " " , myldap_get_dn ( entry ) , attmap_network_cn ) ; return 0 ; } if ( networkname == NULL ) networkname = networknames [ 0 ] ; addresses = myldap_get_values ( entry , attmap_network_ipNetworkNumber ) ; if ( ( addresses == NULL ) || ( addresses [ 0 ] == NULL ) ) { log_log ( LOG_WARNING , " " , myldap_get_dn ( entry ) , attmap_network_ipNetworkNumber ) ; return 0 ; } WRITE_INT32 ( fp , NSLCD_RESULT_BEGIN ) ; WRITE_STRING ( fp , networkname ) ; WRITE_STRINGLIST_EXCEPT ( fp , networknames , networkname ) ; for ( numaddr = 0 ; addresses [ numaddr ] != NULL ; numaddr ++ ) ; WRITE_INT32 ( fp , numaddr ) ; for ( i = 0 ; i < numaddr ; i ++ ) { WRITE_ADDRESS ( fp , entry , attmap_network_ipNetworkNumber , addresses [ i ] ) ; } return 0 ; }
write a single network entry to the stream
write a single network entry to the stream
/* get the most canonical name */ /* get the other names for the network */ /* if the networkname is not yet found, get the first entry from
     * networknames */ /* get the addresses */ /* write the entry */ /* noting */