Hi,
Thanks for your reply.
You have suggested following:
- is the module in LD_LIBRARY_PATH (or getconf CS_LIBPATH) ?
Ashish:-> This I have checked and It is perfectly there.
- does io-net said anything in sloginfo?
Ashish:-> When i run sloginfo It gives following output:
May 21 10:53:16 2 10 0 ixEthMiiLinkStatus failed on PHY0.
Can’t determine the status of the link.
Using default values.
- does your module properly wrote? does it’s entry function get called?
Ashish:-> How can I check whether entry function get called or not? Please see the code. I have written the code to best of my understanding.
#include <stdio.h>
#include <errno.h>
#include <sys/io-net.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
int filter_init(void *dll_hdl, dispatch_t *dpp, io_net_self_t *n, char *options);
int filter_destroy(void *dll_hdl);
int filter_rx_up(npkt_t *npkt, void *func_hdl, int off, int len_sub, uint16_t cell, uint16_t endpoint, uint16_t iface);
int filter_rx_down(npkt_t *npkt, void *rx_down_hdl);
int filter_tx_done(npkt_t *npkt, void *done_hdl, void *func_hdl);
int filter_shutdown1(int registrant_hdl, void *func_hdl);
int filter_shutdown2(int registrant_hdl, void *func_hdl);
int counter_UP = 0;
int counter_DOWN = 0;
io_net_dll_entry_t io_net_dll_entry = {
2,
(void *)filter_init,
(void *)filter_destroy
};
io_net_registrant_funcs_t filter_funcs = {
8,
&filter_rx_up,
&filter_rx_down,
&filter_tx_done,
&filter_shutdown1,
&filter_shutdown2,
NULL,
NULL,
NULL,
NULL
};
io_net_registrant_t filter_reg = {
_REG_FILTER_ABOVE,
“nfm_filter”,
“en”,
“en”,
NULL,
&filter_funcs,
0
};
void * filter_dll_hdl;
dispatch_t * filter_dpp;
io_net_self_t * filter_ion;
int filter_reg_hdl;
///
int filter_init(void *dll_hdl, dispatch_t *dpp, io_net_self_t *ion, char *options)
{
filter_dll_hdl = dll_hdl;
filter_ion = ion;
filter_dpp = dpp;
fprintf(stderr, “\nInside filter_init\n”);
if(filter_ion->reg(filter_dll_hdl, &filter_reg, &filter_reg_hdl, NULL, NULL) == -1)
{
fprintf(stderr, "\nreg-ERROR ");
return (-1);
}
fprintf(stderr, "\ninit-OK reg_hdl=%d ",filter_reg_hdl);
return EOK;
}
///
int filter_destroy(void *dll_hdl)
{
fprintf(stderr, "\ndestroy ");
return EOK;
}
///
int filter_rx_up(npkt_t *npkt, void *func_hdl, int off, int len_sub, uint16_t cell, uint16_t endpoint, uint16_t iface)
{
counter_UP += 1;
fprintf(stderr, "\npkt_UP reg_hdl=%d (%d), framelen = %d ",filter_reg_hdl,counter_UP, npkt->framelen);
if( filter_ion->tx_up(filter_reg_hdl, npkt, off, len_sub, cell, endpoint, iface) <= 0 )
filter_ion->tx_done(filter_reg_hdl, npkt);
return 0;
}
///
int filter_rx_down(npkt_t *npkt, void *rx_down_hdl)
{
counter_DOWN += 1;
fprintf(stderr, "\npkt_DOWN reg_hdl=%d (%d) ",filter_reg_hdl,counter_DOWN);
return filter_ion->tx_down(filter_reg_hdl, npkt);
}
///
int filter_tx_done(npkt_t *npkt, void *done_hdl, void *func_hdl)
{
fprintf(stderr, “\nfilter_tx_done”);
return 0;
}
///
int filter_shutdown1(int registrant_hdl, void *func_hdl)
{
fprintf(stderr, “\nfilter_shutdown1”);
return EOK;
}
///
int filter_shutdown2(int registrant_hdl, void *func_hdl)
{
fprintf(stderr, “\nfilter_shutdown2”);
return 0;
}