Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Fast ethernet without mac/protocol

I have a network that is already working and I want ro take this data without filtering, I want to connect my de2-115 board with the phy connectors and only sniff the data. I the same way I have my data already prepared and packed and I only want to put this in the ethernet wire.

How should I do?? I'm pretty lost and I don't know if is necesary and Ip core or not.

Thank you very much!

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What ip stack are you using?

    This is what I once did with nichestack and TSE MACs, but it also works with other environments, provided the driver structure is the same.

    First, you must get the NET pointer for your target network.

    Say you have declared

    NET mynet;

    After you have correctly assigned mynet pointer, you can access the following functions:

    mynet->pkt_send() // send a packet format

    mynet->raw_send() // send raw data, i.e. buffer, len

    These let you directly send on the network anything you want.

    Sniffing incoming data is a bit more tricky because it depends on your network stack and MAC driver.

    You have to find the best point for accessing rx data: it could be directly the MAC rx isr/poll or some convenient function in the ip stack.

    I'm afraid you have to make changes in library files; AFAIK there's no way to make it otherwise. Although I'm not completely sure on this point: maybe someone else has better advice.