When I want to send trap the routine cannot run

"Alexander King" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi Dave and all:
  
 In my project ,I want to call sendtempJBODTempTrap() in init_uit(),but the the program program interrupt at the sentence as follow:
  
 [SKIP]
 struct jBODTempTable_entry  *jBODTempTable_head,*tempJBODTemp;  /* XXXX */
  
 /* create a new row in the (unsorted) table */
struct jBODTempTable_entry *
jBODTempTable_createEntry(
                 long  jBODTempIndexNum,
                 char jBODTempDENum[NNN],
                 size_t jBODTempDENum_len,
                 long tempBackplaneStatus,
                 long tempBoardAStatus,
                 long tempBoardBStatus
                ) {
    struct jBODTempTable_entry *entry;
     entry = SNMP_MALLOC_TYPEDEF(struct jBODTempTable_entry);
    if (!entry)
        return NULL;
     entry->jBODTempIndexNum = jBODTempIndexNum;
    memcpy(entry->jBODTempDENum, jBODTempDENum, jBODTempDENum_len);
    entry->jBODTempDENum_len = jBODTempDENum_len;
    entry->tempBackplaneStatus = tempBackplaneStatus;
    entry->tempBoardAStatus = tempBoardAStatus;
    entry->tempBoardBStatus = tempBoardBStatus;
    entry->next = jBODTempTable_head;
    jBODTempTable_head = entry;
    tempJBODTemp = jBODTempTable_head;
    return entry;
}
 [SKIP]
 sendtempJBODTempTrap()
{
    system("echo 06692 >>/home/net-snmp/uit.txt");
    int  TABLEINDEX = tempJBODTemp->jBODTempIndexNum;
    system("echo 06699 >>/home/net-snmp/uit.txt");
    if ( TABLEINDEX >= 0 ){
    system("echo 06701 >>/home/net-snmp/uit.txt");
        TABLEINDEX--;
    system("echo 06703 >>/home/net-snmp/uit.txt");
        if ( tempJBODTemp->tempBackplaneStatus != 1 ){                    /* interrupted */
    system("echo 06703 >>/home/net-snmp/uit.txt");
            send_uitJBODTempTraps_trap();
    system("echo 06703 >>/home/net-snmp/uit.txt");
        }
        if ( tempJBODTemp->tempBoardAStatus != 1 ){
            send_uitJBODBoardATempTraps_trap();
        }
        if ( tempJBODTemp->tempBoardBStatus != 1 ){
            send_uitJBODBoardBTempTraps_trap();
        }
    system("echo 06713 >>/home/net-snmp/uit.txt");
        tempJBODTemp  = tempJBODTemp->next;
    }else{
        return;
    }
    system("echo 06709 >>/home/net-snmp/uit.txt");
 }
 [SKIP]
  
 int
send_uitJBODTempTraps_trap( void )
{
    netsnmp_variable_list  *var_list = NULL;
    oid uitJBODTempTraps_oid[] = { 1,3,6,1,4,1,30901,2090,7000,5,0,5 };
    oid jBODTempDENum_oid[] = { 1,3,6,1,4,1,30901,2090,7000,2,4,2,1,1,2, TABLEINDEX/* insert tableindex here */ };
    oid tempBackplaneStatus_oid[] = { 1,3,6,1,4,1,30901,2090,7000,2,4,2,1,1,3,TABLEINDEX /* insert tableindex here */ };
     /*
     * Set the snmpTrapOid.0 value
     */
    snmp_varlist_add_variable(&var_list,
        snmptrap_oid, OID_LENGTH(snmptrap_oid),
        ASN_OBJECT_ID,
        uitJBODTempTraps_oid, sizeof(uitJBODTempTraps_oid));
     /*
     * Add any objects from the trap definition
     */
    snmp_varlist_add_variable(&var_list,
        jBODTempDENum_oid, OID_LENGTH(jBODTempDENum_oid),
        ASN_OCTET_STR,
        /* Set an appropriate value for jBODTempDENum */
        tempJBODTemp->jBODTempDENum, tempJBODTemp->jBODTempDENum_len );
    snmp_varlist_add_variable(&var_list,
        tempBackplaneStatus_oid, OID_LENGTH(tempBackplaneStatus_oid),
        ASN_INTEGER,
        /* Set an appropriate value for tempBackplaneStatus */
        tempJBODTemp->tempBackplaneStatus, sizeof( tempJBODTemp->tempBackplaneStatus ) );
     /*
     * Add any extra (optional) objects here
     */
     /*
     * Send the trap to the list of configured destinations
     *  and clean up
     */
    send_v2trap( var_list );
    snmp_free_varbind( var_list );
     return SNMP_ERR_NOERROR;
}
  
 my initializing is perfect right,so I want to why I am wrong. Thank you very much!

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.