How do I send a raw ethernet frame in python?

后端 未结 2 1861
北海茫月
北海茫月 2021-01-03 08:42

I need to have a project done in a few days, its a basic client and server interface. The catch is that it needs to be all raw sockets. I have no problem with creating that,

2条回答
  •  一生所求
    2021-01-03 09:14

    In answer to your question Andrew, here's an example:

    This answer helped me get WoL working. In this case the data is:

    preamble = bytearray((0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF))
    MAC = bytearray((0x00, 0x14, 0x85, 0xa4, 0x73, 0xce))
    data = PREAMBLE + 16*MAC
    

提交回复
热议问题