Commit Graph

1995 Commits

Author SHA1 Message Date
Guillaume Valadon a2e8bb5da0 Merge pull request #288 from hkwi/dhcpv6_relay_udp_port
dhcp6: add DHCPv6-Relay default port
2016-09-05 09:10:41 +02:00
Pierre Lalet 93767ba7fa Merge pull request #284 from guedou/sessions_fixed
Pickling issues fixed
2016-09-04 23:11:06 +00:00
Pierre Lalet 095adbc1d1 Merge pull request #268 from guedou/python2.5_fix
Useless 'as' keyword breaks Python 2.5 compatibility
2016-09-04 23:08:47 +00:00
Kawai, Hiroaki 255b68b549 dhcp6: add DHCPv6-Relay default port
DHCPv6 serers and relay agents listen for DHCP messages
on UDP port 547 (rfc3315)
2016-09-02 12:35:14 +09:00
Guillaume Valadon 8a817801a7 Merge pull request #282 from alegacy/master
vxlan: fixed incorrect field layout specification
2016-08-31 14:03:52 +02:00
Guillaume Valadon 6a3a6cb714 Pickling issues fixed 2016-08-31 13:59:21 +02:00
Guillaume Valadon 6280482300 Merge pull request #276 from todfreed/master
dhcp6: fix the definition of DHCP6OptIAAddress, which does not have a…
2016-08-31 11:31:05 +02:00
Allain Legacy 9e276ec912 vxlan: fixed incorrect field layout specification
The "NextProtocol" field was added as an unconditional field which made the
VXLAN packet header consume an additional 8-bts when used in a Legacy VXLAN
deployments (flags=0x08) or in GPID deployments (flags=0x88).  The resulting
regression caused incorrect parsing of subsequent headers.  For example, if an
Ethernet header followed the VXLAN header then it would not be interpreted as
an Ethernet header.  The actually interpretation would depend on what value was
stored in the Ether.dst field.

This change updates the field layout specification such that the NextProtocol
field is conditional on flags=0x04, and shortens the reserved field by 8-bits
if that condition is true.

fixes bug #281

Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
2016-08-30 16:13:34 -04:00
Todd Freed bcbb66d808 dhcp6: fix the definition of DHCP6OptIAAddress, which does not have an iaid field
Testing:
Updated dhcp6 regression tests
2016-08-26 10:06:22 -07:00
Guillaume Valadon 7365c97710 Merge pull request #225 from GabrielGanne/nsh-update
NSH: first implementation and small update
2016-08-24 14:24:52 +02:00
Gabriel Ganne dbeb275816 NSH: First implementation
Add support for draft-ietf-sfc-nsh-05.txt

Original commit by: Christophe Fontaine <christophe.fontaine@qosmos.com>

Signed-off-by: Gabriel Ganne <gabriel.ganne@qosmos.com>
2016-08-23 16:18:03 +02:00
Gabriel Ganne d7b900f569 VXLAN: add Generic Packet Encapsulation (GPE) support
Since part of the previously reserved Bytes are now used to annouce
the next header, this also updates the vxlan unit tests.

Original commit by: Christophe Fontaine <christophe.fontaine@qosmos.com>

Signed-off-by: Gabriel Ganne <gabriel.ganne@qosmos.com>
2016-08-22 11:42:36 +02:00
Guillaume Valadon 18f3a91c44 Useless 'as' keyword breaks Python 2.5 compatibility 2016-08-16 16:36:06 +02:00
Guillaume Valadon 5b5bd11933 Travis CI improvements (#258) 2016-08-12 11:36:08 +00:00
Guillaume Valadon 02ae08b4ad Workaround to ignore interfaces name truncated by netstat
When interface names are longer than 7 characters, netstat will truncate
them to the first 7 chars which leads to looking up an invalid interface
name.
We attempt to guess the name of the interface based on the output of
ifconfig -l. If there is only one candidate we consider it, otherwise we
ignore it.
2016-08-12 11:35:02 +00:00
susengold 004b9f8c3b Import missing & mixup of psm status/result values in bluetooth.py #189 (#198)
* Fix missing import and mixup result / status in L2Cap Conn Resp

in scapy/layers/bluetooth.py

* Delete bluetooth.py

* fix missing import and mixup of result/status in L2Cap ConnResp

* Delete bluetooth.patch

* fixed missing import and mixup of result/status in L2Cap ConnResp

* Update bluetooth.py
2016-08-09 15:50:28 +02:00
plorinquer 164a52c075 NTP module update (#254)
* References to the 'Raw' class were replaced by conf.raw_layer.
* Fix potential infinite loop in NTPExtPacketListField::getfield() + typo.
* Added regression test (Extension dissection test).
2016-08-05 08:02:11 +00:00
Robin Jarry 170700a4b8 VXLAN improvements (#247)
* layers/vxlan: add group policy extension support
This is based on the following draft RFC:
http://tools.ietf.org/html/draft-smith-vxlan-group-policy-00

Add more unit tests in regression.uts.

Signed-off-by: Robin Jarry <robin.jarry@6wind.com>

* Move VXLAN to layers

VXLAN has an official RFC: http://tools.ietf.org/html/rfc7348
It should be in automatically loaded layers.

Move tests to regression.uts.

Signed-off-by: Robin Jarry <robin.jarry@6wind.com>

* load_contrib: fallback to layers when contrib not found

Useful when a scapy.contrib module has been moved to scapy.layers.

Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
2016-08-04 15:30:25 +02:00
Pierre Lalet d85738f71f Merge pull request #251 from X-Cli/clean_modbus
Rewrite of some modbus tests in a more pythonish and robust way
2016-08-03 18:02:33 +00:00
Florian Maury f65f1bacdf rewriting some modbus tests in a more pythonish and robust way 2016-08-03 19:43:07 +02:00
Pierre Lalet 550eea16ed Merge pull request #252 from X-Cli/ignore_pyo
Add .pyo to the ignored files
2016-08-03 15:01:29 +00:00
Florian Maury 7bc0bd9899 Add .pyo to the ignored files 2016-08-03 13:49:42 +02:00
Pierre Lalet 9201f1cf13 Merge pull request #240 from 6WIND/lib-friendly
Make scapy usable as a third party library
2016-08-01 19:09:14 +00:00
Robin Jarry 4d31afe779 Only enable console logging when running interactive session
By default, only a NullHandler is added to the 'scapy' logger. This
allows third party applications that use scapy as a library to control
the logging of scapy messages.

Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
2016-08-01 18:42:31 +02:00
Robin Jarry af35135c8c Prevent namespace pollution
Some symbols are "internal" to modules (__all__, __file__, __doc__,
__package__, etc.) they should *not* be replaced by the one from other
modules.

The "from xxx import *" python syntax construct takes this into account
and only imports the "public" symbols (i.e., those whose name does not
start with an underscore). When a __all__ symbol is defined in a module
(it should be a list of strings), the "from xxx import *" construct only
imports the names listed in xxx.__all__.

Avoid shadowing module specific symbols when dynamically loading layers
and other modules by only importing "public" symbols.

Fix importing the "tls" layer along the way (remove erroneous __all__
definition).

Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
2016-08-01 18:42:31 +02:00
Robin Jarry 6057906368 Fix individual modules import
When using scapy as a third party library, we do not "benefit" from the
loading routine that puts all symbols in the __builtin__ namespace. This
implies that all modules must be "importable" without any errors for
undefined symbols.

This patch fixes importing every scapy module individually. Some
circular imports were fixed (between inet6 and dhcp6).

Most errors were detected by using pylint with the right configuration
(scapy produces a *lot* of errors). Other errors were detected with the
following shell script:

    export PYTHONPATH=".:$PYTHONPATH"
    for f in $(find scapy/ -name '*.py'); do
        f=${f%/__init__.py}
        module=$(echo ${f%.py} | sed 's,/,.,g')
        python -c "import $module; print $module"
    done

Also, replace all implicit relative imports by absolute imports to avoid
surprises with some python versions.

Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
2016-08-01 18:42:31 +02:00
plorinquer 1e48e13fc5 NTP module update 2016-08-01 16:48:01 +02:00
Robin Jarry d08624615a layers/l2: add QinQ 802.1ad support (#241)
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
2016-07-30 15:51:12 +02:00
Martijn Thé 2c28f06d82 Bluetooth: Add LE Connection Update command & event types (#234) 2016-07-30 15:47:42 +02:00
X_Cli 42b7c20d5a Fix call to "super" methods on BitMultiEnumField (#239) 2016-07-29 10:28:01 +00:00
plorinquer 3ee32c2867 'packages' list in setup.py has been updated. (#224)
* 'packages' list in setup.py has been updated.

* Fix ecdsa ImportError.
2016-07-27 13:27:51 +02:00
X_Cli dcd0db3ec7 base_classes.py: dispatch_hook: conf variable is undefined in the global scope (#228)
Fix `Raw` and `conf` undefined
2016-07-26 07:41:17 +00:00
Pierre Lalet 8a438b3eae Merge pull request #226 from plorinquer/eapol-eap-tests-update
EAPOL / EAP class tests updated
2016-07-23 09:46:42 +00:00
Pierre Lorinquer 64e98a35f1 regression.uts: assert() statements added to the EAPOL / EAP class tests to make them fail. 2016-07-22 13:13:32 +02:00
mtury 4faaaac043 cert.py improvements (#175)
cert.py improvements

* Improve cert.py : independence from openssl, ECDSA support, sign/verify capabilities

* Make travis install python-ecdsa

* Clarify ECDSA support

* Cleaning up for cert.py
2016-07-20 14:17:12 +02:00
Guillaume Valadon 724ad29308 Merge pull request #219 from mtury/asn1_hightag
Fix support and add test for ASN.1 (unknown) high-tag-number
2016-07-19 09:30:13 +02:00
Guillaume Valadon b4d3d2f19d Merge pull request #223 from GabrielGanne/gtk-runtime-error-fix
Fix scapy init when gtk is not available
2016-07-19 09:01:03 +02:00
mtu 342e68fc36 Add ASN.1 (unknown) high-tag-number dissection+building support 2016-07-18 17:26:40 +02:00
Gabriel Ganne bc0195ba73 Fix scapy init without gtk
matplotlib.pyplot inits gtk, which may not be available.
If so, handles this as if the import failed.
2016-07-18 16:24:58 +02:00
Pierre Lalet b859999d6b Merge pull request #213 from secdev/IPv6_hashret
Use IPv6 source and destination addresses in hashret()
2016-07-11 08:21:45 +00:00
Pierre Lalet 7962a57f71 Merge pull request #214 from secdev/IPv4_mutlicast
IPv4 mDNS support
2016-07-11 08:21:22 +00:00
Pierre Lalet 7c53ff42ea Merge pull request #216 from guedou/notebook_pipes
Simple pipe example
2016-07-11 08:20:01 +00:00
Sébastien Mainand 88c1dbac32 doc improvement proposal (#207) 2016-07-08 08:48:44 +02:00
Guillaume Valadon 5717ef86bb Wrong docstring fixed (#215) 2016-07-08 08:47:29 +02:00
Guillaume Valadon bded69bfe3 Simple pipe example 2016-07-07 17:01:29 +02:00
Guillaume Valadon 86ad139195 Add explicit support for IPv4 mDNS 2016-07-06 16:42:50 +02:00
Guillaume Valadon a24f657bfd Use IPv6 source and destination addresses in hashret() 2016-07-06 16:38:57 +02:00
plorinquer 2251e2ed22 EAPOL / EAP updates. (#211)
EAPOL / EAP updates and regression tests
2016-07-06 15:18:14 +02:00
Pierre Lalet 48c5a335db Merge pull request #212 from guedou/show_import_fixed
Missing import in packet.py
2016-07-06 13:02:16 +00:00
Guillaume Valadon e5a3004e85 Missing import 2016-07-06 14:43:41 +02:00