From 7bf7000941798ac70226a514a2535c6917f4b0e7 Mon Sep 17 00:00:00 2001
From: Vincas Dargis <vindrg@gmail.com>
Date: Sat, 15 Dec 2018 12:35:52 +0200
Subject: [PATCH] Add Bitcoin macros

Add macros for various Bitcoin daemon ports.
---
 Shorewall/Macros/macro.Bitcoin    | 8 ++++++++
 Shorewall/Macros/macro.BitcoinRPC | 8 ++++++++
 Shorewall/Macros/macro.BitcoinZMQ | 9 +++++++++
 3 files changed, 25 insertions(+)
 create mode 100644 Shorewall/Macros/macro.Bitcoin
 create mode 100644 Shorewall/Macros/macro.BitcoinRPC
 create mode 100644 Shorewall/Macros/macro.BitcoinZMQ

diff --git a/Shorewall/Macros/macro.Bitcoin b/Shorewall/Macros/macro.Bitcoin
new file mode 100644
index 000000000..7f0a765fa
--- /dev/null
+++ b/Shorewall/Macros/macro.Bitcoin
@@ -0,0 +1,8 @@
+#
+# Shorewall --/usr/share/shorewall/macro.Bitcoin
+#
+# Macro for handling Bitcoin P2P traffic
+#
+##############################################################################################################################################################
+#ACTION		SOURCE		DEST		PROTO	DPORT	SPORT	ORIGDEST	RATE	USER	MARK	CONNLIMIT	TIME	HEADERS	SWITCH	HELPER
+PARAM		-			-			tcp		8333
diff --git a/Shorewall/Macros/macro.BitcoinRPC b/Shorewall/Macros/macro.BitcoinRPC
new file mode 100644
index 000000000..646246637
--- /dev/null
+++ b/Shorewall/Macros/macro.BitcoinRPC
@@ -0,0 +1,8 @@
+#
+# Shorewall --/usr/share/shorewall/macro.BitcoinRPC
+#
+# Macro for handling Bitcoin RPC traffic
+#
+##############################################################################################################################################################
+#ACTION		SOURCE		DEST		PROTO	DPORT	SPORT	ORIGDEST	RATE	USER	MARK	CONNLIMIT	TIME	HEADERS	SWITCH	HELPER
+PARAM		-			-			tcp		8332
diff --git a/Shorewall/Macros/macro.BitcoinZMQ b/Shorewall/Macros/macro.BitcoinZMQ
new file mode 100644
index 000000000..25406c1f3
--- /dev/null
+++ b/Shorewall/Macros/macro.BitcoinZMQ
@@ -0,0 +1,9 @@
+#
+# Shorewall --/usr/share/shorewall/macro.BitcoinZMQ
+#
+# Macro for handling Bitcoin ZMQ traffic
+# See https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md
+#
+##############################################################################################################################################################
+#ACTION		SOURCE		DEST		PROTO	DPORT	SPORT	ORIGDEST	RATE	USER	MARK	CONNLIMIT	TIME	HEADERS	SWITCH	HELPER
+PARAM		-			-			tcp		28332