> > mplsTunnelARHopTable_get_first_data_point(... )
> > mplsTunnelARHopTable_get_next_data_point(... )
> 
> Those are the ones you need to concentrate on.
> The simplest approach is probably to read in the
> table as part of the 'get_first_data_point' routine,
> and walk through the list in 'get_next_data_point'

i tried to put my code at the very beginning of
get_first_data_point().
i wrote the code like this to see if it would work:
...
    table_info->min_column = 3;
    table_info->max_column = 6;
...
structure mplsTunnelARHopTable{
ulong <index1>;
ulong <index2>;
int   mplsTunnelARHopAddrType;
char  mplsTunnelARHopIpAddr[16];
char  mplsTunnelARHopAddrUnnum[16];
char  mplsTunnelARHopLspId[16];
struct ... *next;
}

get_first_data_point()
{
    struct mplsTunnelARHopTable_entry *newrow;
    newrow = mplsTunnelARHopTable_createEntry(100,1);
    newrow->mplsTunnelARHopAddrType = 1;
   
strcpy(newrow->mplsTunnelARHopIpAddr,"10.10.80.198");
    strcpy(newrow->mplsTunnelARHopAddrUnnum,"");
    strcpy(newrow->mplsTunnelARHopLspId,"");

    ......
    ......
}

i left all the other code unchanged.
when i ran the snmpd ,i could normally get the other
objects.
however as long as i get this table,snmpd went down.

i used the strace

36, 0, {sa_family=AF_INET, sin_port=htons(1025),
sin_addr=inet_addr("10.10.80.198"
)}, [16]) = 48
7481  gettimeofday({1115437983, 538033}, NULL) = 0
7481  brk(0)                            = 0x812d000
7481  brk(0x812e000)                    = 0x812e000
7481  brk(0)                            = 0x812e000
7481  brk(0x812f000)                    = 0x812f000
7481  --- SIGSEGV (Segmentation fault) @ 0 (0) ---

i tried snmp -D
...
helper:table:req: Got request for handler table: base
oid:MPLS-TE-STD-MIB::mplsTunnelARHopTable
MPLS-TE-STD-MIB::mplsTunnelARHopAddrType.100.1
trace: table_helper_handler(): table.c, 377:
helper:table:col:   have at least a column (3)
trace: table_helper_handler(): table.c, 451:
helper:table:     have 2 bytes of index
trace: table_helper_handler(): table.c, 494:
helper:table:   looking for 2 indexes
trace: parse_one_oid_index(): mib.c, 3639:
parse_oid_indexes: Parsed int(66): 100
trace: table_helper_handler(): table.c, 534:
helper:table:   got 1 (incomplete=0)
trace: parse_one_oid_index(): mib.c, 3639:
parse_oid_indexes: Parsed int(66): 1
trace: table_helper_handler(): table.c, 534:
helper:table:   got 1 (incomplete=0)
trace: table_helper_handler(): table.c, 548:
helper:table:results:   found 2 indexes
trace: table_helper_handler(): table.c, 556:
helper:table:results:   column: 3, indexes: 2trace:
sprint_realloc_by_type(): mib.c, 1975:
output: sprint_by_type, type 66
   index: type=66(42), value=Gauge32: 100trace:
sprint_realloc_by_type(): mib.c, 1975:
output: sprint_by_type, type 66
   index: type=66(42), value=Gauge32: 1
trace: netsnmp_call_handler(): agent_handler.c, 418:
handler:calling: calling handler table_iterator for
mode GET

it seemed that when getting into the iterator hook
routines,the agent stopped for segment fault.

i just wonder where i can look into now.
any suggestions?
thanks a lot :)

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to