Merge pull request #495 from micmac1/sngrep-ssl
sngrep: update to snapshot + options
This commit is contained in:
commit
b2cb60201b
3 changed files with 37 additions and 74 deletions
|
@ -8,50 +8,72 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=sngrep
|
PKG_NAME:=sngrep
|
||||||
PKG_VERSION=1.4.6
|
|
||||||
PKG_RELEASE:=1
|
|
||||||
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
|
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
|
||||||
PKG_LICENSE:=GPL-3.0+
|
PKG_LICENSE:=GPL-3.0+
|
||||||
PKG_LICENSE_FILES:=COPYING
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE_URL:=https://github.com/irontec/sngrep.git
|
||||||
PKG_SOURCE_URL:=https://github.com/irontec/$(PKG_NAME)/releases/download/v$(PKG_VERSION)
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_HASH:=638d6557dc68db401b07d73b2e7f8276800281f021fe0c942992566d6b59a48a
|
PKG_SOURCE_VERSION:=564ad9264ebe8b77ed18a923fef3643de920087c
|
||||||
|
PKG_SOURCE_DATE=2019-12-02
|
||||||
|
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_MIRROR_HASH:=94e150cabe3efc6f07d05e3ee348806a0a8fa9335d27dfddce477988b946ed8f
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
PKG_FIXUP:=autoreconf
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
PKG_INSTALL:=1
|
PKG_INSTALL:=1
|
||||||
|
|
||||||
|
PKG_CONFIG_DEPENDS:=CONFIG_IPV6 CONFIG_SNGREP_ENABLE_EEP CONFIG_SNGREP_WITH_PCRE
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define Package/sngrep
|
define Package/sngrep
|
||||||
SECTION:=utils
|
SECTION:=utils
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
SUBMENU:=Telephony
|
SUBMENU:=Telephony
|
||||||
DEPENDS:=+libncursesw +libopenssl +libpcap +libpcre
|
DEPENDS:=+libncursesw +libopenssl +libpcap +SNGREP_WITH_PCRE:libpcre
|
||||||
TITLE:=Ncurses SIP messages flow viewer
|
TITLE:=Ncurses SIP messages flow viewer
|
||||||
URL:=https://github.com/irontec/sngrep
|
URL:=https://github.com/irontec/sngrep
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/sngrep/description
|
define Package/sngrep/description
|
||||||
sngrep displays SIP messages grouped by Call-Id into flow diagrams. It
|
sngrep is a tool for displaying SIP calls message flows from terminal.
|
||||||
can be used as an offline pcap viewer or for online capture using
|
|
||||||
libpcap functions.
|
|
||||||
|
|
||||||
It supports SIP UDP and TCP transports (when each message is delivered
|
It supports live capture to display realtime SIP packets and can also be
|
||||||
in one packet).
|
used as PCAP viewer.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/sngrep/conffiles
|
define Package/sngrep/conffiles
|
||||||
/etc/sngreprc
|
/etc/sngreprc
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/sngrep/config
|
||||||
|
menu "sngrep configuration"
|
||||||
|
depends on PACKAGE_sngrep
|
||||||
|
|
||||||
|
config SNGREP_ENABLE_EEP
|
||||||
|
bool "EEP/HEP support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable EEP/HEP support
|
||||||
|
|
||||||
|
config SNGREP_WITH_PCRE
|
||||||
|
bool "PCRE support"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable Perl compatible regular expressions
|
||||||
|
endmenu
|
||||||
|
endef
|
||||||
|
|
||||||
CONFIGURE_ARGS += \
|
CONFIGURE_ARGS += \
|
||||||
--enable-eep \
|
--$(if $(CONFIG_SNGREP_ENABLE_EEP),en,dis)able-eep \
|
||||||
--enable-ipv6 \
|
--$(if $(CONFIG_IPV6),en,dis)able-ipv6 \
|
||||||
--enable-unicode \
|
--enable-unicode \
|
||||||
--with-openssl \
|
--with-openssl \
|
||||||
--with-pcre
|
--with$(if $(CONFIG_SNGREP_WITH_PCRE),,out)-pcre
|
||||||
|
|
||||||
define Package/sngrep/install
|
define Package/sngrep/install
|
||||||
$(INSTALL_DIR) $(1)/etc
|
$(INSTALL_DIR) $(1)/etc
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
commit 604f6d0ce2ec42ac494d76c95e68850ea6e7da8f
|
|
||||||
Author: Sebastian Kemper <sebastian_ml@gmx.net>
|
|
||||||
Date: Sun Nov 4 16:58:00 2018 +0100
|
|
||||||
|
|
||||||
capture: fix typo in FILE object
|
|
||||||
|
|
||||||
FILE *fstdin is defined, but when calling freopen() stdin is used instead
|
|
||||||
of fstdin.
|
|
||||||
|
|
||||||
This causes the compile to fail:
|
|
||||||
|
|
||||||
CC sngrep-capture.o
|
|
||||||
capture.c: In function 'capture_offline':
|
|
||||||
capture.c:194:21: error: assignment of read-only variable 'stdin'
|
|
||||||
if (!(stdin = freopen("/dev/tty", "r", stdin))) {
|
|
||||||
^
|
|
||||||
make[5]: *** [Makefile:519: sngrep-capture.o] Error 1
|
|
||||||
|
|
||||||
This commit fixes the typo.
|
|
||||||
|
|
||||||
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
|
|
||||||
|
|
||||||
diff --git a/src/capture.c b/src/capture.c
|
|
||||||
index 911c35f..a799413 100644
|
|
||||||
--- a/src/capture.c
|
|
||||||
+++ b/src/capture.c
|
|
||||||
@@ -191,7 +191,7 @@ capture_offline(const char *infile, const char *outfile)
|
|
||||||
|
|
||||||
// Reopen tty for ncurses after pcap have used stdin
|
|
||||||
if (!strncmp(infile, "/dev/stdin", 10)) {
|
|
||||||
- if (!(stdin = freopen("/dev/tty", "r", stdin))) {
|
|
||||||
+ if (!(fstdin = freopen("/dev/tty", "r", stdin))) {
|
|
||||||
fprintf(stderr, "Failed to reopen tty while using stdin for capture.");
|
|
||||||
return 1;
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
commit c474a2dd04df56ae8a28e3bf22a12c9b57155ce4
|
|
||||||
Author: Liviu Chircu <liviu@opensips.org>
|
|
||||||
Date: Sat Dec 8 20:00:36 2018 +0200
|
|
||||||
|
|
||||||
sip: Do not crash on invalid CSeq values
|
|
||||||
|
|
||||||
Bad CSeq headers such as:
|
|
||||||
CSeq: 115211521152 INVITE\r\n
|
|
||||||
|
|
||||||
... would immediately cause a crash.
|
|
||||||
|
|
||||||
diff --git a/src/sip.c b/src/sip.c
|
|
||||||
index a916558..1a7f1b9 100644
|
|
||||||
--- a/src/sip.c
|
|
||||||
+++ b/src/sip.c
|
|
||||||
@@ -192,7 +192,7 @@ sip_init(int limit, int only_calls, int no_incomplete)
|
|
||||||
"^(X-Call-ID|X-CID):[ ]*([^ ]+)[ ]*\r$", match_flags);
|
|
||||||
}
|
|
||||||
regcomp(&calls.reg_response, "^SIP/2.0[ ]*(([0-9]{3}) [^\r]*)[ ]*\r", match_flags & ~REG_NEWLINE);
|
|
||||||
- regcomp(&calls.reg_cseq, "^CSeq:[ ]*([0-9]+) .+\r$", match_flags);
|
|
||||||
+ regcomp(&calls.reg_cseq, "^CSeq:[ ]*([0-9]{1,10}) .+\r$", match_flags);
|
|
||||||
regcomp(&calls.reg_from, "^(From|f):[ ]*[^:]*:(([^@>]+)@?[^\r>;]+)", match_flags);
|
|
||||||
regcomp(&calls.reg_to, "^(To|t):[ ]*[^:]*:(([^@>]+)@?[^\r>;]+)", match_flags);
|
|
||||||
regcomp(&calls.reg_valid, "^([A-Z]+ [a-zA-Z]+:|SIP/2.0 [0-9]{3})", match_flags & ~REG_NEWLINE);
|
|
Loading…
Reference in a new issue