Added (simple) module-level docstrings for all modules
diff --git a/scapy/__init__.py b/scapy/__init__.py
index 9e773ac..443b367 100644
--- a/scapy/__init__.py
+++ b/scapy/__init__.py
@@ -3,7 +3,12 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Scapy: create, send, sniff, dissect and manipulate network packets.
+Usable either from an interactive console or as a Python library.
+http://www.secdev.org/projects/scapy
+"""
if __name__ == "__main__":
from scapy.main import interact
diff --git a/scapy/all.py b/scapy/all.py
index f6cf00e..e0af8b1 100644
--- a/scapy/all.py
+++ b/scapy/all.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Aggregate top level objects from all Scapy modules.
+"""
from base_classes import *
from config import *
diff --git a/scapy/ansmachine.py b/scapy/ansmachine.py
index 88c7f5d..2a90adc 100644
--- a/scapy/ansmachine.py
+++ b/scapy/ansmachine.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Answering machines.
+"""
+
########################
## Answering machines ##
########################
diff --git a/scapy/arch/__init__.py b/scapy/arch/__init__.py
index 0963c8d..95f95ec 100644
--- a/scapy/arch/__init__.py
+++ b/scapy/arch/__init__.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Operating system specific functionality.
+"""
+
import sys,os,socket
from scapy.error import *
diff --git a/scapy/arch/bsd.py b/scapy/arch/bsd.py
index 0bcb3ae..1be7bd7 100644
--- a/scapy/arch/bsd.py
+++ b/scapy/arch/bsd.py
@@ -3,7 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
-
+"""
+Support for BSD-like operating systems such as FreeBSD, OpenBSD and Mac OS X.
+"""
LOOPBACK_NAME="lo0"
diff --git a/scapy/arch/linux.py b/scapy/arch/linux.py
index 4f5bb13..4321bda 100644
--- a/scapy/arch/linux.py
+++ b/scapy/arch/linux.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Linux specific functions.
+"""
from __future__ import with_statement
import sys,os,struct,socket,time
diff --git a/scapy/arch/pcapdnet.py b/scapy/arch/pcapdnet.py
index 60fe742..bb2419f 100644
--- a/scapy/arch/pcapdnet.py
+++ b/scapy/arch/pcapdnet.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Packet sending and receiving with libdnet and libpcap/WinPcap.
+"""
+
import time,struct,sys
if not sys.platform.startswith("win"):
from fcntl import ioctl
diff --git a/scapy/arch/solaris.py b/scapy/arch/solaris.py
index 3b7e2fe..3117076 100644
--- a/scapy/arch/solaris.py
+++ b/scapy/arch/solaris.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Customization for the Solaris operation system.
+"""
# IPPROTO_GRE is missing on Solaris
import socket
diff --git a/scapy/arch/unix.py b/scapy/arch/unix.py
index b13418c..151a08f 100644
--- a/scapy/arch/unix.py
+++ b/scapy/arch/unix.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Common customizations for all Unix-like operating systems other than Linux
+"""
import sys,os,struct,socket,time
from fcntl import ioctl
diff --git a/scapy/arch/windows/__init__.py b/scapy/arch/windows/__init__.py
index 06b7d2f..31808eb 100755
--- a/scapy/arch/windows/__init__.py
+++ b/scapy/arch/windows/__init__.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Customizations needed to support Microsoft Windows.
+"""
+
import os,re,sys,socket,time
from glob import glob
from scapy.config import conf,ConfClass
diff --git a/scapy/as_resolvers.py b/scapy/as_resolvers.py
index 7a82ee0..24573c2 100644
--- a/scapy/as_resolvers.py
+++ b/scapy/as_resolvers.py
@@ -3,6 +3,11 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Resolve Autonomous Systems (AS).
+"""
+
+
import socket
from config import conf
diff --git a/scapy/asn1/__init__.py b/scapy/asn1/__init__.py
index a02c899..4827a58 100644
--- a/scapy/asn1/__init__.py
+++ b/scapy/asn1/__init__.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Package holding ASN.1 related modules.
+"""
+
# We do not import mib.py because it is more bound to scapy and
# less prone to be used in a standalone fashion
__all__ = ["asn1","ber"]
diff --git a/scapy/asn1/asn1.py b/scapy/asn1/asn1.py
index f333cbe..bad7b2c 100644
--- a/scapy/asn1/asn1.py
+++ b/scapy/asn1/asn1.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+ASN.1 (Abstract Syntax Notation One)
+"""
+
import random
from scapy.config import conf
from scapy.error import Scapy_Exception,warning
diff --git a/scapy/asn1/ber.py b/scapy/asn1/ber.py
index 1e66ffd..2312e02 100644
--- a/scapy/asn1/ber.py
+++ b/scapy/asn1/ber.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Basic Encoding Rules (BER) for ASN.1
+"""
+
from scapy.error import warning
from scapy.utils import inet_aton,inet_ntoa
from asn1 import ASN1_Decoding_Error,ASN1_Encoding_Error,ASN1_BadTag_Decoding_Error,ASN1_Codecs,ASN1_Class_UNIVERSAL,ASN1_Error,ASN1_DECODING_ERROR,ASN1_BADTAG
diff --git a/scapy/asn1/mib.py b/scapy/asn1/mib.py
index c539655..8531fcf 100644
--- a/scapy/asn1/mib.py
+++ b/scapy/asn1/mib.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Management Information Base (MIB) parsing
+"""
+
import re
from glob import glob
from scapy.dadict import DADict,fixname
diff --git a/scapy/asn1fields.py b/scapy/asn1fields.py
index c32fbe3..6849ffe 100644
--- a/scapy/asn1fields.py
+++ b/scapy/asn1fields.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Classes that implement ASN.1 data structures.
+"""
+
from asn1.asn1 import *
from asn1.ber import *
from volatile import *
diff --git a/scapy/asn1packet.py b/scapy/asn1packet.py
index dc900b0..5728749 100644
--- a/scapy/asn1packet.py
+++ b/scapy/asn1packet.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Packet holding data in Abstract Syntax Notation (ASN.1).
+"""
+
from packet import *
class ASN1_Packet(Packet):
diff --git a/scapy/automaton.py b/scapy/automaton.py
index 332709d..7502ac5 100644
--- a/scapy/automaton.py
+++ b/scapy/automaton.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Automata with states, transitions and actions.
+"""
+
from __future__ import with_statement
import types,itertools,time,os,sys,socket
from select import select
diff --git a/scapy/autorun.py b/scapy/autorun.py
index 85eec93..a453494 100644
--- a/scapy/autorun.py
+++ b/scapy/autorun.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Run commands when the Scapy interpreter starts.
+"""
+
import code,sys
from config import conf
from themes import *
diff --git a/scapy/base_classes.py b/scapy/base_classes.py
index c2fa4b7..e54428a 100644
--- a/scapy/base_classes.py
+++ b/scapy/base_classes.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Generators and packet meta classes.
+"""
+
###############
## Generators ##
################
diff --git a/scapy/config.py b/scapy/config.py
index 394221d..ae9ae17 100644
--- a/scapy/config.py
+++ b/scapy/config.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Implementation for of the configuration object.
+"""
+
import os,time,socket,sys
from data import *
import base_classes
diff --git a/scapy/crypto/__init__.py b/scapy/crypto/__init__.py
index a29ecf8..b441863 100644
--- a/scapy/crypto/__init__.py
+++ b/scapy/crypto/__init__.py
@@ -3,7 +3,9 @@
## Copyright (C) Arnaud Ebalard <arno@natisbad.org>
## This program is published under a GPLv2 license
-
+"""
+Tools for handling with digital certificates.
+"""
try:
import Crypto
diff --git a/scapy/crypto/cert.py b/scapy/crypto/cert.py
index b10b4ee..3d254fa 100644
--- a/scapy/crypto/cert.py
+++ b/scapy/crypto/cert.py
@@ -3,6 +3,10 @@
## Copyright (C) Arnaud Ebalard <arno@natisbad.org>
## This program is published under a GPLv2 license
+"""
+Cryptographic certificates.
+"""
+
import os, sys, math, socket, struct, sha, hmac, string, time
import random, popen2, tempfile
from scapy.utils import strxor
diff --git a/scapy/dadict.py b/scapy/dadict.py
index 0ba66a6..dcfd2a7 100644
--- a/scapy/dadict.py
+++ b/scapy/dadict.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Direct Access dictionary.
+"""
+
from error import Scapy_Exception
###############################
diff --git a/scapy/data.py b/scapy/data.py
index 820232f..de01cfc 100644
--- a/scapy/data.py
+++ b/scapy/data.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Global variables and functions for handling external data sets.
+"""
+
import os,sys,re
from dadict import DADict
from error import log_loading
diff --git a/scapy/error.py b/scapy/error.py
index b97c8a9..29ebc1b 100644
--- a/scapy/error.py
+++ b/scapy/error.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Logging subsystem and basic exception class.
+"""
#############################
##### Logging subsystem #####
diff --git a/scapy/fields.py b/scapy/fields.py
index 7989a67..a700a73 100644
--- a/scapy/fields.py
+++ b/scapy/fields.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Fields: basic data structures that make up parts of packets.
+"""
+
import struct,copy,socket
from config import conf
from volatile import *
diff --git a/scapy/layers/__init__.py b/scapy/layers/__init__.py
index 881e0e3..a3f2afb 100644
--- a/scapy/layers/__init__.py
+++ b/scapy/layers/__init__.py
@@ -2,3 +2,7 @@
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+
+"""
+Layer package.
+"""
diff --git a/scapy/layers/all.py b/scapy/layers/all.py
index 6251c2a..c6bb379 100644
--- a/scapy/layers/all.py
+++ b/scapy/layers/all.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+All layers. Configurable with conf.load_layers.
+"""
+
from scapy.config import conf
from scapy.error import log_loading
diff --git a/scapy/layers/bluetooth.py b/scapy/layers/bluetooth.py
index 89757a9..40828f4 100644
--- a/scapy/layers/bluetooth.py
+++ b/scapy/layers/bluetooth.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Bluetooth layers, sockets and send/receive functions.
+"""
+
import socket,struct
from scapy.config import conf
diff --git a/scapy/layers/dhcp.py b/scapy/layers/dhcp.py
index a542e88..ee8645d 100644
--- a/scapy/layers/dhcp.py
+++ b/scapy/layers/dhcp.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+DHCP (Dynamic Host Configuration Protocol) d BOOTP
+"""
+
import struct
from scapy.packet import *
diff --git a/scapy/layers/dhcp6.py b/scapy/layers/dhcp6.py
index 07eee8a..8fa8999 100644
--- a/scapy/layers/dhcp6.py
+++ b/scapy/layers/dhcp6.py
@@ -6,6 +6,10 @@
## Copyright (C) 2005 Guillaume Valadon <guedou@hongo.wide.ad.jp>
## Arnaud Ebalard <arnaud.ebalard@eads.net>
+"""
+DHCPv6: Dynamic Host Configuration Protocol for IPv6. [RFC 3315]
+"""
+
import socket
from scapy.packet import *
from scapy.fields import *
diff --git a/scapy/layers/dns.py b/scapy/layers/dns.py
index 7ca570e..29c8fbe 100644
--- a/scapy/layers/dns.py
+++ b/scapy/layers/dns.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+DNS: Domain Name System.
+"""
+
import socket,struct
from scapy.packet import *
diff --git a/scapy/layers/dot11.py b/scapy/layers/dot11.py
index 5fbf512..a96def3 100644
--- a/scapy/layers/dot11.py
+++ b/scapy/layers/dot11.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Wireless LAN according to IEEE 802.11.
+"""
+
import re,struct
from scapy.packet import *
diff --git a/scapy/layers/gprs.py b/scapy/layers/gprs.py
index fa944d8..31a931f 100644
--- a/scapy/layers/gprs.py
+++ b/scapy/layers/gprs.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+GPRS (General Packet Radio Service) for mobile data communication.
+"""
from scapy.fields import *
from scapy.packet import *
diff --git a/scapy/layers/hsrp.py b/scapy/layers/hsrp.py
index 2e7e4a4..c981f39 100644
--- a/scapy/layers/hsrp.py
+++ b/scapy/layers/hsrp.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+HSRP (Hot Standby Router Protocol): proprietary redundancy protocol for Cisco routers.
+"""
+
from scapy.fields import *
from scapy.packet import *
from scapy.layers.inet import UDP
diff --git a/scapy/layers/inet.py b/scapy/layers/inet.py
index b26a0cd..0de93e7 100644
--- a/scapy/layers/inet.py
+++ b/scapy/layers/inet.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+IPv4 (Internet Protocol v4).
+"""
+
import os,time,struct,re,socket,new
from select import select
from collections import defaultdict
diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py
index f30ac79..372dac7 100644
--- a/scapy/layers/inet6.py
+++ b/scapy/layers/inet6.py
@@ -19,6 +19,10 @@
## ##
#############################################################################
+"""
+IPv6 (Internet Protocol v6).
+"""
+
import socket
if not socket.has_ipv6:
diff --git a/scapy/layers/ir.py b/scapy/layers/ir.py
index daf49a6..fc738c5 100644
--- a/scapy/layers/ir.py
+++ b/scapy/layers/ir.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+IrDA infrared data communication.
+"""
+
from scapy.packet import *
from scapy.fields import *
from scapy.layers.l2 import CookedLinux
diff --git a/scapy/layers/isakmp.py b/scapy/layers/isakmp.py
index ccbad10..8fab225 100644
--- a/scapy/layers/isakmp.py
+++ b/scapy/layers/isakmp.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+ISAKMP (Internet Security Association and Key Management Protocol).
+"""
+
import struct
from scapy.packet import *
from scapy.fields import *
diff --git a/scapy/layers/l2.py b/scapy/layers/l2.py
index 6fd1141..c90545d 100644
--- a/scapy/layers/l2.py
+++ b/scapy/layers/l2.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Classes and functions for layer 2 protocols.
+"""
+
import os,struct,time
from scapy.base_classes import Net
from scapy.config import conf
diff --git a/scapy/layers/l2tp.py b/scapy/layers/l2tp.py
index 62c39f4..0b56db2 100644
--- a/scapy/layers/l2tp.py
+++ b/scapy/layers/l2tp.py
@@ -3,6 +3,12 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+L2TP (Layer 2 Tunneling Protocol) for VPNs.
+
+[RFC 2661]
+"""
+
import struct
from scapy.packet import *
diff --git a/scapy/layers/llmnr.py b/scapy/layers/llmnr.py
index 561729c..f87425f 100644
--- a/scapy/layers/llmnr.py
+++ b/scapy/layers/llmnr.py
@@ -3,6 +3,11 @@
from scapy.layers.inet import UDP
from scapy.layers.dns import DNSQRField, DNSRRField, DNSRRCountField
+"""
+LLMNR (Link Local Multicast Node Resolution).
+
+[RFC 4795]
+"""
#############################################################################
### LLMNR (RFC4795) ###
diff --git a/scapy/layers/mgcp.py b/scapy/layers/mgcp.py
index aee14ca..5d8a064 100644
--- a/scapy/layers/mgcp.py
+++ b/scapy/layers/mgcp.py
@@ -3,6 +3,12 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+MGCP (Media Gateway Control Protocol)
+
+[RFC 2805]
+"""
+
from scapy.packet import *
from scapy.fields import *
from scapy.layers.inet import UDP
diff --git a/scapy/layers/mobileip.py b/scapy/layers/mobileip.py
index af81866..bbaa8ce 100644
--- a/scapy/layers/mobileip.py
+++ b/scapy/layers/mobileip.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Mobile IP.
+"""
+
from scapy.fields import *
from scapy.packet import *
from scapy.layers.inet import IP,UDP
diff --git a/scapy/layers/netbios.py b/scapy/layers/netbios.py
index 3253c52..605e06f 100644
--- a/scapy/layers/netbios.py
+++ b/scapy/layers/netbios.py
@@ -3,6 +3,12 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+NetBIOS over TCP/IP
+
+[RFC 1001/1002]
+"""
+
import struct
from scapy.packet import *
from scapy.fields import *
diff --git a/scapy/layers/netflow.py b/scapy/layers/netflow.py
index 02addee..4456773 100644
--- a/scapy/layers/netflow.py
+++ b/scapy/layers/netflow.py
@@ -3,6 +3,11 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Cisco NetFlow protocol v1
+"""
+
+
from scapy.fields import *
from scapy.packet import *
diff --git a/scapy/layers/ntp.py b/scapy/layers/ntp.py
index ffebdfc..6d11966 100644
--- a/scapy/layers/ntp.py
+++ b/scapy/layers/ntp.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+NTP (Network Time Protocol).
+"""
+
import time
from scapy.packet import *
from scapy.fields import *
diff --git a/scapy/layers/pflog.py b/scapy/layers/pflog.py
index 3c62941..a8fc9fe 100644
--- a/scapy/layers/pflog.py
+++ b/scapy/layers/pflog.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+PFLog: OpenBSD PF packet filter logging.
+"""
+
from scapy.packet import *
from scapy.fields import *
from scapy.layers.inet import IP
diff --git a/scapy/layers/ppp.py b/scapy/layers/ppp.py
index 67fc3f2..50c6846 100644
--- a/scapy/layers/ppp.py
+++ b/scapy/layers/ppp.py
@@ -3,6 +3,12 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+PPP (Point to Point Protocol)
+
+[RFC 1661]
+"""
+
import struct
from scapy.packet import *
from scapy.layers.l2 import *
diff --git a/scapy/layers/radius.py b/scapy/layers/radius.py
index e3661e0..1323960 100644
--- a/scapy/layers/radius.py
+++ b/scapy/layers/radius.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+RADIUS (Remote Authentication Dial In User Service)
+"""
+
import struct
from scapy.packet import *
from scapy.fields import *
diff --git a/scapy/layers/rip.py b/scapy/layers/rip.py
index 51eab66..baf3233 100644
--- a/scapy/layers/rip.py
+++ b/scapy/layers/rip.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+RIP (Routing Information Protocol).
+"""
+
from scapy.packet import *
from scapy.fields import *
from scapy.layers.inet import UDP
diff --git a/scapy/layers/rtp.py b/scapy/layers/rtp.py
index 83116f4..629dccd 100644
--- a/scapy/layers/rtp.py
+++ b/scapy/layers/rtp.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+RTP (Real-time Transport Protocol).
+"""
+
from scapy.packet import *
from scapy.fields import *
diff --git a/scapy/layers/sctp.py b/scapy/layers/sctp.py
index 82e4e4f..5e3a182 100644
--- a/scapy/layers/sctp.py
+++ b/scapy/layers/sctp.py
@@ -4,6 +4,10 @@
## Copyright (C) 6WIND <olivier.matz@6wind.com>
## This program is published under a GPLv2 license
+"""
+SCTP (Stream Control Transmission Protocol).
+"""
+
import struct
from scapy.packet import *
diff --git a/scapy/layers/sebek.py b/scapy/layers/sebek.py
index 2459ae8..c54e672 100644
--- a/scapy/layers/sebek.py
+++ b/scapy/layers/sebek.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Sebek: Linux kernel module for data collection on honeypots.
+"""
+
from scapy.fields import *
from scapy.packet import *
from scapy.layers.inet import UDP
diff --git a/scapy/layers/skinny.py b/scapy/layers/skinny.py
index 827c6bc..9fb6ac0 100644
--- a/scapy/layers/skinny.py
+++ b/scapy/layers/skinny.py
@@ -3,12 +3,14 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Cisco Skinny protocol.
+"""
+
from scapy.packet import *
from scapy.fields import *
from scapy.layers.inet import TCP
-# Cisco Skinny protocol
-
# shamelessly ripped from Ethereal dissector
skinny_messages = {
# Station -> Callmanager
diff --git a/scapy/layers/smb.py b/scapy/layers/smb.py
index b851f51..73ebe5b 100644
--- a/scapy/layers/smb.py
+++ b/scapy/layers/smb.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+SMB (Server Message Block), also known as CIFS.
+"""
+
from scapy.packet import *
from scapy.fields import *
from scapy.layers.netbios import NBTSession
diff --git a/scapy/layers/snmp.py b/scapy/layers/snmp.py
index 0681825..2c58825 100644
--- a/scapy/layers/snmp.py
+++ b/scapy/layers/snmp.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+SNMP (Simple Network Management Protocol).
+"""
+
from scapy.asn1packet import *
from scapy.asn1fields import *
from scapy.layers.inet import UDP
diff --git a/scapy/layers/tftp.py b/scapy/layers/tftp.py
index 28c569e..16a782c 100644
--- a/scapy/layers/tftp.py
+++ b/scapy/layers/tftp.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+TFTP (Trivial File Transfer Protocol).
+"""
+
import os,random
from scapy.packet import *
from scapy.fields import *
diff --git a/scapy/layers/vrrp.py b/scapy/layers/vrrp.py
index a08a42f..f874b35 100644
--- a/scapy/layers/vrrp.py
+++ b/scapy/layers/vrrp.py
@@ -4,6 +4,10 @@
## Copyright (C) 6WIND <olivier.matz@6wind.com>
## This program is published under a GPLv2 license
+"""
+VRRP (Virtual Router Redundancy Protocol).
+"""
+
from scapy.packet import *
from scapy.fields import *
from scapy.layers.inet import IP
diff --git a/scapy/layers/x509.py b/scapy/layers/x509.py
index f8388d1..18aaa5e 100644
--- a/scapy/layers/x509.py
+++ b/scapy/layers/x509.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+X.509 certificates.
+"""
+
from scapy.asn1packet import *
from scapy.asn1fields import *
diff --git a/scapy/main.py b/scapy/main.py
index beb70af..ec9aee2 100644
--- a/scapy/main.py
+++ b/scapy/main.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Main module for interactive startup.
+"""
from __future__ import generators
import os,sys
diff --git a/scapy/modules/__init__.py b/scapy/modules/__init__.py
index 881e0e3..6303dad 100644
--- a/scapy/modules/__init__.py
+++ b/scapy/modules/__init__.py
@@ -2,3 +2,7 @@
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+
+"""
+Package of extension modules that have to be loaded explicitly.
+"""
diff --git a/scapy/modules/geoip.py b/scapy/modules/geoip.py
index e635969..8b308a4 100644
--- a/scapy/modules/geoip.py
+++ b/scapy/modules/geoip.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+GeoIP: find out the geographical location of IP addresses
+"""
+
from scapy.data import KnowledgeBase
from scapy.config import conf
diff --git a/scapy/modules/nmap.py b/scapy/modules/nmap.py
index ffed334..fc53f42 100644
--- a/scapy/modules/nmap.py
+++ b/scapy/modules/nmap.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Clone of Nmap's first generation OS fingerprinting.
+"""
+
import os
from scapy.data import KnowledgeBase
diff --git a/scapy/modules/p0f.py b/scapy/modules/p0f.py
index ebcf68d..21bbd92 100644
--- a/scapy/modules/p0f.py
+++ b/scapy/modules/p0f.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Clone of p0f passive OS fingerprinting
+"""
+
from scapy.data import KnowledgeBase
from scapy.config import conf
from scapy.layers.inet import IP, TCP, TCPOptions
diff --git a/scapy/modules/queso.py b/scapy/modules/queso.py
index 6284cd9..ebc5486 100644
--- a/scapy/modules/queso.py
+++ b/scapy/modules/queso.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Clone of queso OS fingerprinting
+"""
+
from scapy.data import KnowledgeBase
from scapy.config import conf
from scapy.layers.inet import IP,TCP
diff --git a/scapy/modules/voip.py b/scapy/modules/voip.py
index 0d0b4da..d221ecf 100644
--- a/scapy/modules/voip.py
+++ b/scapy/modules/voip.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+VoIP (Voice over IP) related functions
+"""
+
import os
###################
## Testing stuff ##
diff --git a/scapy/packet.py b/scapy/packet.py
index 1f51f31..0accd35 100644
--- a/scapy/packet.py
+++ b/scapy/packet.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Packet class. Binding mechanism. fuzz() method.
+"""
+
import time,itertools,os
from fields import StrField,ConditionalField,Emph,PacketListField
from config import conf
diff --git a/scapy/plist.py b/scapy/plist.py
index 4cb01a7..0abe460 100644
--- a/scapy/plist.py
+++ b/scapy/plist.py
@@ -3,6 +3,11 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+PacketList: holds several packets and allows to do operations on them.
+"""
+
+
import os,subprocess
from config import conf
from base_classes import BasePacket,BasePacketList
diff --git a/scapy/pton_ntop.py b/scapy/pton_ntop.py
index 8f83697..1bd8892 100644
--- a/scapy/pton_ntop.py
+++ b/scapy/pton_ntop.py
@@ -3,12 +3,15 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Convert IPv6 addresses between textual representation and binary.
+
+These functions are missing when python is compiled
+without IPv6 support, on Windows for instance.
+"""
import socket,struct
-# These functions are missing when python is compiled
-# without IPv6 support, on Windows for instance
-
def inet_pton(af, addr):
"""Convert an IP address from text representation into binary form"""
if af == socket.AF_INET:
diff --git a/scapy/route.py b/scapy/route.py
index d63176c..52a9562 100644
--- a/scapy/route.py
+++ b/scapy/route.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Routing and handling of network interfaces.
+"""
+
import socket
from arch import read_routes,get_if_addr,LOOPBACK_NAME
from utils import atol,ltoa,itom
diff --git a/scapy/route6.py b/scapy/route6.py
index 9533399..51116aa 100644
--- a/scapy/route6.py
+++ b/scapy/route6.py
@@ -6,6 +6,9 @@
## Copyright (C) 2005 Guillaume Valadon <guedou@hongo.wide.ad.jp>
## Arnaud Ebalard <arnaud.ebalard@eads.net>
+"""
+Routing and network interface handling for IPv6.
+"""
#############################################################################
#############################################################################
diff --git a/scapy/sendrecv.py b/scapy/sendrecv.py
index b72d965..a50bd7e 100644
--- a/scapy/sendrecv.py
+++ b/scapy/sendrecv.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Functions to send and receive packets.
+"""
+
import cPickle,os,sys,time,subprocess
from select import select
from data import *
diff --git a/scapy/supersocket.py b/scapy/supersocket.py
index acd4989..c5ebe46 100644
--- a/scapy/supersocket.py
+++ b/scapy/supersocket.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+SuperSocket.
+"""
+
import socket,time
from config import conf
from data import *
diff --git a/scapy/themes.py b/scapy/themes.py
index 866de0e..188fd54 100644
--- a/scapy/themes.py
+++ b/scapy/themes.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Color themes for the interactive console.
+"""
##################
## Color themes ##
diff --git a/scapy/tools/UTscapy.py b/scapy/tools/UTscapy.py
index f8790ac..ff8460c 100755
--- a/scapy/tools/UTscapy.py
+++ b/scapy/tools/UTscapy.py
@@ -3,6 +3,9 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Unit testing infrastructure for Scapy
+"""
import sys,getopt,imp
import bz2, base64, os.path, time, traceback, zlib, sha
diff --git a/scapy/tools/__init__.py b/scapy/tools/__init__.py
index 881e0e3..af6eec7 100644
--- a/scapy/tools/__init__.py
+++ b/scapy/tools/__init__.py
@@ -2,3 +2,7 @@
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+
+"""
+Additional tools to be run separately
+"""
diff --git a/scapy/utils.py b/scapy/utils.py
index 06f451e..07e3a8a 100644
--- a/scapy/utils.py
+++ b/scapy/utils.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+General utility functions.
+"""
+
import os,sys,socket,types
import random,time
import gzip,zlib,cPickle
diff --git a/scapy/utils6.py b/scapy/utils6.py
index eab813b..9d12081 100644
--- a/scapy/utils6.py
+++ b/scapy/utils6.py
@@ -6,6 +6,9 @@
## Copyright (C) 2005 Guillaume Valadon <guedou@hongo.wide.ad.jp>
## Arnaud Ebalard <arnaud.ebalard@eads.net>
+"""
+Utility functions for IPv6.
+"""
from config import conf
from data import *
diff --git a/scapy/volatile.py b/scapy/volatile.py
index de29459..dcb704c 100644
--- a/scapy/volatile.py
+++ b/scapy/volatile.py
@@ -3,6 +3,10 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
+"""
+Fields that hold random numbers.
+"""
+
import random,time,math
from base_classes import Net
from utils import corrupt_bits,corrupt_bytes
diff --git a/setup.py b/setup.py
index 92a0c53..aecd37f 100755
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,9 @@
#! /usr/bin/env python
+"""
+Distutils setup file for Scapy.
+"""
+
from distutils import archive_util
from distutils import sysconfig