Trap Implementation Idea????

2004-07-30 Thread s sayeed
Hi 

I have just gone through the trap tutorial and the
notification example for trap. I could get trap
successfully from snmpd.

Now I need to design some traps that would be
triggered when an event has occurred somewhere outside
the agent. To be more specific, my agent is running on
a Linux box. I have PCI card on that box that runs a
task from a processor. Within the scope of this task I
need a trap to be generated once certain event has
occurred. 

Previously we used SNMP research agent with our
windows platform. We used to directly call
DoV2cTrapToDest() or kind of "trap2send" from our code
with the help of an agent library.

What could be the possibility for net-snmp to
communicate with the other task and generate an event
instantly?

Thanks,

Sabina



__
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail


---
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
___
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


mib2c.iterate.conf table implementation problem

2004-07-30 Thread s sayeed
Hi

I am trying to implement a table using net-snmp5.1. I
have a  simple array that I want to rertieve from this
table. When I do a walk on this table it loops forever
in my get_next entry function. I have attached
relevant part of my code. It would be of great help if
you could suggest me any thing wrong there.

--
--  Example Tables MIB defination
--

lnbCustom2Table OBJECT-TYPE
SYNTAX  SEQUENCE OF LnbCustom2Entry
MAX-ACCESS  not-accessible
STATUS  current
DESCRIPTION
""
::= { lnbTypeCustom2 3 }

lnbCustom2Entry OBJECT-TYPE
SYNTAX  LnbCustom2Entry
MAX-ACCESS  not-accessible
STATUS  current
DESCRIPTION
"A row describing a given working group"
INDEX   { lnbEntryLoBand }
::= {lnbCustom2Table 1 }

LnbCustom2Entry ::= SEQUENCE {
lnbEntryLoBand  Counter32,
lnbEntryHiBand  Counter32,
lnbEntryOscFreq Counter32,
lnbEntryPolar   INTEGER,
lnbEntryToneINTEGER,
lnbEntryVoltage  INTEGER
}

///Agent implementation 

/My structure///
typedef struct
{   
  unsigned intloBand;   
  unsigned inthiBand;   
  unsigned intlocalOscFreq;
  TUNER_polarization_t polarization; 
  TUNER_tone_t tone;
  TUNER_voltage_t  voltage; 

} __attribute__ ((packed)) TUNER_bandinfo_t;


TUNER_bandinfo_t custom2table[4];

***during initialization of the table I load this
table with appropiate value and make sure they are ok.


My  get (first/next function)

netsnmp_variable_list *
lnbCustom2Table_get_first_data_point(
void **my_loop_context,
void **my_data_context,
netsnmp_variable_list *put_index_data,
 netsnmp_iterator_info *mydata)
{

*my_loop_context = 0 ;

return lnbCustom2Table_get_next_data_point
(my_loop_context, my_data_context, put_index_data,
mydata);
}


netsnmp_variable_list *
lnbCustom2Table_get_next_data_point(
void **my_loop_context,
void **my_data_context,
netsnmp_variable_list *put_index_data,
 netsnmp_iterator_info *mydata)
{
int i = (int)*my_loop_context;
DEBUGMSGTL(("lnbCustom2Table",
 "lnbCustom2Table_get_next_data_point \n"));


netsnmp_variable_list *vptr;
vptr = put_index_data;

snmp_set_var_value(vptr, 
 (u_char *)&custom2table[i].loBand,
  sizeof(custom2table[i].loBand) );

DEBUGMSGTL(("lnbCustom2Table",
 "lnbCustom2Table_get_next_data_point loBand\n"));


*my_data_context = (void*)&custom2table[i];
*my_loop_context =  (void*)++i;

DEBUGMSGTL(("lnbCustom2Table",
 "lnbCustom2Table_get_next_data_point end\n"));

return put_index_data;
}
Following is my Debug Output//
Turning on AgentX master support.
NET-SNMP version 5.1
lnbCustom2Table: lnbCustom2Table_get_first_data_point
lnbCustom2Table: lnbCustom2Table_get_next_data_point
lnbCustom2Table: lnbCustom2Table_get_next_data_point
loBand
lnbCustom2Table: lnbCustom2Table_get_next_data_point
end
lnbCustom2Table: lnbCustom2Table_get_next_data_point
lnbCustom2Table: lnbCustom2Table_get_next_data_point
loBand
lnbCustom2Table: lnbCustom2Table_get_next_data_point
end
lnbCustom2Table: lnbCustom2Table_get_next_data_point
lnbCustom2Table: lnbCustom2Table_get_next_data_point
loBand
lnbCustom2Table: lnbCustom2Table_get_next_data_point
end
lnbCustom2Table: lnbCustom2Table_get_next_data_point
lnbCustom2Table: lnbCustom2Table_get_next_data_point
loBand
lnbCustom2Table: lnbCustom2Table_get_next_data_point
end
lnbCustom2Table: lnbCustom2Table_get_next_data_point
lnbCustom2Table: lnbCustom2Table_get_next_data_point
loBand
lnbCustom2Table: lnbCustom2Table_get_next_data_point
end


Thanks
Sabina




__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 


---
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
___
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