Skip to content

Commit c01b8db

Browse files
committed
Raw packet documentation
1 parent 17ef2cb commit c01b8db

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

rawsocketpy/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Package init
1+
"""A Raw socket implementation allowing any ethernet type to be used/sniffed.
2+
3+
.. moduleauthor:: Alexis Paques <alexis.paques@gmail.com>
4+
5+
"""
26
from __future__ import print_function
37
try:
48
from gevent import monkey; monkey.patch_all()

rawsocketpy/main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22
from .util import get_hw, to_str, protocol_to_ethertype, to_bytes
33

44
class RawPacket():
5+
"""RawPacket is the resulting data container.
6+
7+
It reads raw data and stores the MAC source, MAC destination, the Ethernet type and the data payload.
8+
9+
RawPacket.success is true if the packet is successfuly read.
10+
"""
511
def __init__(self, data):
12+
"""A really simple class.
13+
14+
Args:
15+
foo (data): raw ethernet frame coming from the socket library, either **bytes in Python3** or **str in Python2**
16+
"""
617
self.dest = ""
718
self.src = ""
819
self.type = ""

0 commit comments

Comments
 (0)