aboutsummaryrefslogtreecommitdiffstats
path: root/packages/python/python-scapy_2.0.0.9.bb
blob: ebe122341838bb02fb82fb5b4b8410933ef1109a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
DESCRIPTION = "Scapy is a powerful interactive packet manipulation tool, \
packet generator, network scanner, network discovery, packet sniffer, etc. \
It can for the moment replace hping, 85% of nmap, arpspoof, arp-sk, arping, \
tcpdump, tethereal, p0f, ...."
SECTION = "devel/python"
HOMEPAGE = "http://www.secdev.org/projects/scapy/"
LICENSE = "GPL"
PRIORITY = "optional"
SRCNAME = "scapy"
PR = "ml1"

SRC_URI = "http://www.secdev.org/projects/scapy/files/scapy-${PV}.tar.gz"
S = "${WORKDIR}/${SRCNAME}-${PV}"

inherit distutils

RDEPENDS = "\
  python-netclient \
  python-netserver \
"
rray (const float *ptr, int count, unsigned char *buffer, float normfact static inline void d2alaw_array (const double *ptr, int count, unsigned char *buffer, double normfact) { while (--count >= 0) - { if (ptr [count] >= 0) + { if (!isfinite (ptr [count])) + buffer [count] = 0 ; + else if (ptr [count] >= 0) buffer [count] = alaw_encode [lrint (normfact * ptr [count])] ; else buffer [count] = 0x7F & alaw_encode [- lrint (normfact * ptr [count])] ; diff --git a/src/ulaw.c b/src/ulaw.c index e50b4cb..b6070ad 100644 --- a/src/ulaw.c +++ b/src/ulaw.c @@ -19,6 +19,7 @@ #include "sfconfig.h" #include <math.h> +#include <limits.h> #include "sndfile.h" #include "common.h" @@ -827,7 +828,9 @@ s2ulaw_array (const short *ptr, int count, unsigned char *buffer) static inline void i2ulaw_array (const int *ptr, int count, unsigned char *buffer) { while (--count >= 0) - { if (ptr [count] >= 0) + { if (ptr [count] == INT_MIN) + buffer [count] = ulaw_encode [INT_MAX >> (16 + 2)] ; + else if (ptr [count] >= 0) buffer [count] = ulaw_encode [ptr [count] >> (16 + 2)] ; else buffer [count] = 0x7F & ulaw_encode [-ptr [count] >> (16 + 2)] ; @@ -847,7 +850,9 @@ f2ulaw_array (const float *ptr, int count, unsigned char *buffer, float normfact static inline void d2ulaw_array (const double *ptr, int count, unsigned char *buffer, double normfact) { while (--count >= 0) - { if (ptr [count] >= 0) + { if (!isfinite (ptr [count])) + buffer [count] = 0 ; + else if (ptr [count] >= 0) buffer [count] = ulaw_encode [lrint (normfact * ptr [count])] ; else buffer [count] = 0x7F & ulaw_encode [- lrint (normfact * ptr [count])] ; -- 2.7.4