Question

I'm stumped trying to get etherOutputHookAdd() to work. Its counterpart, etherInputHookAdd(), seems to work fine. The OS version in question is VxWorks 5.4 .

The hook code looks like so (the code I intend to actually run is more complicated, but this serves for an example.)

int anCounter;
STATUS etherHook(struct ifnet *pif, char *buf, int size)
{
    anCounter += 1;
    return FALSE;
}

I can hook up etherInputHookAdd from the vxworks shell like so

etherInputHookAdd etherHook,"fei",0

This returns 0 (STATUS OK), after which examination of the 'anCounter' variable will indicate activity as expected. However, no such luck with the output direction. I've tried both of these command lines

etherOutputHookAdd etherHook,"fei",0
etherOutputHookAdd etherHook

Both of these return OK, but the hook routine doesn't seem to be getting called at all. My best hypotheses are (1) I'm missing an initialization step, or calling it wrong, (2) the etherOutputHookAdd implementation is just a stub, (3) you just can't call it from the shell, or (4) maybe my nic driver implementation is buggy.

Any ideas that solve the central problem - how do I see what's being sent off my board - are welcome.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top