diff mbox

tcping: new package

Message ID 1378912077-8707-1-git-send-email-rebillout@syscom.ch
State Changes Requested
Headers show

Commit Message

Arnaud Rébillout Sept. 11, 2013, 3:07 p.m. UTC
tcping does a TCP connect to the given ip/port combination. The user can
specify a timeout in seconds. This is useful in shell scripts running in
firewalled environments. Often SYNs are just being dropped by firewalls,
thus connection establishment will be retried several times (for
minutes) until a TCP timeout is reached. With tcping it is possible to
check first if the desired port is reachable and then start connection
establishment.

http://www.linuxco.de/tcping/tcping.html
Signed-off-by: Arnaud Rébillout <rebillout@syscom.ch>
---
 package/Config.in        |  1 +
 package/tcping/Config.in |  7 +++++++
 package/tcping/tcping.mk | 27 +++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 package/tcping/Config.in
 create mode 100644 package/tcping/tcping.mk

Comments

Thomas Petazzoni Sept. 12, 2013, 4:44 p.m. UTC | #1
Dear Arnaud Rébillout,

Thanks for this contribution! A few comments below, if you could fix
them and resend an updated version, that'd be great!

> http://www.linuxco.de/tcping/tcping.html
> Signed-off-by: Arnaud Rébillout <rebillout@syscom.ch>

First, leave one empty line before the Signed-off-by line.

On Wed, 11 Sep 2013 17:07:57 +0200, Arnaud Rébillout wrote:

> diff --git a/package/tcping/Config.in b/package/tcping/Config.in
> new file mode 100644
> index 0000000..d440c56
> --- /dev/null
> +++ b/package/tcping/Config.in
> @@ -0,0 +1,7 @@
> +config BR2_PACKAGE_TCPING
> +	bool "tcping"
> +	help
> +	  tcping does a TCP connect to the given ip/port combination. 

I believe you could put here a slightly longer description, such as the
one you've written in your commit log.

> +	  http://www.linuxco.de/tcping/tcping.html
> +
> diff --git a/package/tcping/tcping.mk b/package/tcping/tcping.mk
> new file mode 100644
> index 0000000..67bb30a
> --- /dev/null
> +++ b/package/tcping/tcping.mk
> @@ -0,0 +1,27 @@
> +#############################################################
> +#
> +# tcping
> +#
> +#############################################################

There should be 80 # dashes, and an empty line between this header and
the first variable.

> +TCPING_VERSION = 1.3.5
> +TCPING_SOURCE = tcping-$(TCPING_VERSION).tar.gz

This last line is not needed since it is the default value.

> +TCPING_SITE = http://www.linuxco.de/tcping
> +TCPING_LICENSE = GPLv3+

You should add another line here for the licensing informations:

TCPING_LICENSE_FILES = LICENSE

this will automatically consider the file called 'LICENSE' in the
tcping source tree as the license file.

> +define TCPING_BUILD_CMDS
> +	$(MAKE) CC="$(TARGET_CC)" CCFLAGS="$(TARGET_CFLAGS)" -C $(@D) tcping.linux
> +endef

It's quite unfortunate that the Makefile uses the non-standard CCFLAGS
instead of CFLAGS, but ok.

> +define TCPING_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/tcping $(TARGET_DIR)/usr/bin/tcping
> +endef
> +
> +define TCPING_UNINSTALL_TARGET_CMDS
> +	rm -f $(TARGET_DIR)/usr/bin/tcping
> +endef
> +
> +define TCPING_CLEAN_CMDS
> +	-$(MAKE) -C $(@D) clean
> +endef

You can remove the uninstall and clean commands, we are going to remove
them soon.

Other than that, looks good! Thanks again!

Thomas
Arnaud Rébillout Sept. 13, 2013, 7:29 a.m. UTC | #2
Dear Thomas Petazzoni,

thanks for your feedback, the corrected version will come soon.

Best regards

On 09/12/2013 06:44 PM, Thomas Petazzoni wrote:
> Dear Arnaud Rébillout,
>
> Thanks for this contribution! A few comments below, if you could fix
> them and resend an updated version, that'd be great!
>
>> http://www.linuxco.de/tcping/tcping.html
>> Signed-off-by: Arnaud Rébillout <rebillout@syscom.ch>
> First, leave one empty line before the Signed-off-by line.
>
> On Wed, 11 Sep 2013 17:07:57 +0200, Arnaud Rébillout wrote:
>
>> diff --git a/package/tcping/Config.in b/package/tcping/Config.in
>> new file mode 100644
>> index 0000000..d440c56
>> --- /dev/null
>> +++ b/package/tcping/Config.in
>> @@ -0,0 +1,7 @@
>> +config BR2_PACKAGE_TCPING
>> +	bool "tcping"
>> +	help
>> +	  tcping does a TCP connect to the given ip/port combination.
> I believe you could put here a slightly longer description, such as the
> one you've written in your commit log.
>
>> +	  http://www.linuxco.de/tcping/tcping.html
>> +
>> diff --git a/package/tcping/tcping.mk b/package/tcping/tcping.mk
>> new file mode 100644
>> index 0000000..67bb30a
>> --- /dev/null
>> +++ b/package/tcping/tcping.mk
>> @@ -0,0 +1,27 @@
>> +#############################################################
>> +#
>> +# tcping
>> +#
>> +#############################################################
> There should be 80 # dashes, and an empty line between this header and
> the first variable.
>
>> +TCPING_VERSION = 1.3.5
>> +TCPING_SOURCE = tcping-$(TCPING_VERSION).tar.gz
> This last line is not needed since it is the default value.
>
>> +TCPING_SITE = http://www.linuxco.de/tcping
>> +TCPING_LICENSE = GPLv3+
> You should add another line here for the licensing informations:
>
> TCPING_LICENSE_FILES = LICENSE
>
> this will automatically consider the file called 'LICENSE' in the
> tcping source tree as the license file.
>
>> +define TCPING_BUILD_CMDS
>> +	$(MAKE) CC="$(TARGET_CC)" CCFLAGS="$(TARGET_CFLAGS)" -C $(@D) tcping.linux
>> +endef
> It's quite unfortunate that the Makefile uses the non-standard CCFLAGS
> instead of CFLAGS, but ok.
>
>> +define TCPING_INSTALL_TARGET_CMDS
>> +	$(INSTALL) -D -m 0755 $(@D)/tcping $(TARGET_DIR)/usr/bin/tcping
>> +endef
>> +
>> +define TCPING_UNINSTALL_TARGET_CMDS
>> +	rm -f $(TARGET_DIR)/usr/bin/tcping
>> +endef
>> +
>> +define TCPING_CLEAN_CMDS
>> +	-$(MAKE) -C $(@D) clean
>> +endef
> You can remove the uninstall and clean commands, we are going to remove
> them soon.
>
> Other than that, looks good! Thanks again!
>
> Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 2351839..fc1ec87 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -854,6 +854,7 @@  source "package/squid/Config.in"
 source "package/strongswan/Config.in"
 source "package/stunnel/Config.in"
 source "package/tcpdump/Config.in"
+source "package/tcping/Config.in"
 source "package/tcpreplay/Config.in"
 if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/tftpd/Config.in"
diff --git a/package/tcping/Config.in b/package/tcping/Config.in
new file mode 100644
index 0000000..d440c56
--- /dev/null
+++ b/package/tcping/Config.in
@@ -0,0 +1,7 @@ 
+config BR2_PACKAGE_TCPING
+	bool "tcping"
+	help
+	  tcping does a TCP connect to the given ip/port combination. 
+
+	  http://www.linuxco.de/tcping/tcping.html
+
diff --git a/package/tcping/tcping.mk b/package/tcping/tcping.mk
new file mode 100644
index 0000000..67bb30a
--- /dev/null
+++ b/package/tcping/tcping.mk
@@ -0,0 +1,27 @@ 
+#############################################################
+#
+# tcping
+#
+#############################################################
+TCPING_VERSION = 1.3.5
+TCPING_SOURCE = tcping-$(TCPING_VERSION).tar.gz
+TCPING_SITE = http://www.linuxco.de/tcping
+TCPING_LICENSE = GPLv3+
+
+define TCPING_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC)" CCFLAGS="$(TARGET_CFLAGS)" -C $(@D) tcping.linux
+endef
+
+define TCPING_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/tcping $(TARGET_DIR)/usr/bin/tcping
+endef
+
+define TCPING_UNINSTALL_TARGET_CMDS
+	rm -f $(TARGET_DIR)/usr/bin/tcping
+endef
+
+define TCPING_CLEAN_CMDS
+	-$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(generic-package))