[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-coders
Subject:    two questions to ask
From:       WuSteven <wqhsunshine () hotmail ! com>
Date:       2009-10-26 6:40:15
Message-ID: COL122-W49EA49B0A08418B24BAB17B0BA0 () phx ! gbl
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi all,

      Sorry to interrupt you, but I have two questions to ask, which would cost you a \
little time. 

      It is my first to use net-snmp to develop a snmp agent with private mibs. And \
when I compiled the mibs to C codes, I found something I cannot understand.Here is my \
codes.

 

/* create a new row in the table */
struct bg9300BoardInfoTable_entry *
bg9300BoardInfoTable_createEntry(netsnmp_container *container, 
                 , long  bg9300BoardInfoSlotId   // first
                ) {
    struct bg9300BoardInfoTable_entry *entry;

    entry = SNMP_MALLOC_TYPEDEF(struct bg9300BoardInfoTable_entry);
    if (!entry)
        return NULL;

    entry->bg9300BoardInfoSlotId = bg9300BoardInfoSlotId;
    entry->oid_index.len  = XXX;   //second
    entry->oid_index.oids = YYY;
    CONTAINER_INSERT( container, entry );
    return entry;
}

 

    The first question is,  why the function have an extra ',' in the parameter list? \
How many parameters in deed at this situation? If there were some more parameters, \
why not inform us below as a remark ?

    The second question is, the entry have two variables "oid_index.len" and \
"oid_index.oids", which would be known from the mib definition. I don't know why we \
should correct them manually, or they would have some other means in the section of \
the codes.

 

    I am waitting for your answer.Thank you.

 

 

                                                  Steven
 		 	   		  
_________________________________________________________________
È«Ð  Windows 7£º¼ò»¯ÄúµÄÈÕ³£¹¤×÷¡£Ñ°ÕÒ×îÊʺÏÄúµÄ PC¡£
http://www.microsoft.com/china/windows/buy/ 


[Attachment #5 (text/html)]

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi all,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sorry to interrupt you, but I have two questions to \
ask, which would cost you a little time. <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It is my \
first to use net-snmp to develop&nbsp;a snmp agent with private mibs. And when I \
compiled the mibs to C codes, I found something I cannot understand.Here is my \
codes.<BR> &nbsp;<BR>
/* create a new row in the table */<BR>struct bg9300BoardInfoTable_entry \
*<BR>bg9300BoardInfoTable_createEntry(netsnmp_container *container, \
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
, long&nbsp; bg9300BoardInfoSlotId&nbsp;&nbsp; \
//&nbsp;first<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
) {<BR>&nbsp;&nbsp;&nbsp; struct bg9300BoardInfoTable_entry *entry;<BR> \
&nbsp;&nbsp;&nbsp; entry = SNMP_MALLOC_TYPEDEF(struct \
bg9300BoardInfoTable_entry);<BR>&nbsp;&nbsp;&nbsp; if \
(!entry)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<BR> \
&nbsp;&nbsp;&nbsp; entry-&gt;bg9300BoardInfoSlotId = \
bg9300BoardInfoSlotId;<BR>&nbsp;&nbsp;&nbsp; entry-&gt;oid_index.len&nbsp; = \
XXX;&nbsp;&nbsp; //second<BR>&nbsp;&nbsp;&nbsp; entry-&gt;oid_index.oids = \
YYY;<BR>&nbsp;&nbsp;&nbsp; CONTAINER_INSERT( container, entry \
);<BR>&nbsp;&nbsp;&nbsp; return entry;<BR>}<BR> &nbsp;<BR>
&nbsp;&nbsp;&nbsp; The first question is,&nbsp; why the function have an extra ',' in \
the&nbsp;parameter list? How many parameters in deed at this situation? If there were \
some more parameters, why not inform us&nbsp;below&nbsp;as a remark ?<BR> \
&nbsp;&nbsp;&nbsp; The second question is, the entry have two variables \
"oid_index.len" and "oid_index.oids", which would be known from the mib definition. I \
don't know why we should correct them manually, or they would have some other means \
in the section of the codes.<BR> &nbsp;<BR>
&nbsp;&nbsp;&nbsp; I am waitting for your answer.Thank you.<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Steven<BR> \
<br /><hr />Windows 7£º¼ò»¯ÄúµÄÈÕ³£¹¤×÷¡£ <a \
href='http://www.microsoft.com/china/windows/buy/ ' target='_new'>Ñ°ÕÒ×îÊʺÏÄúµÄ \
PC¡£</a></body> </html>



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic