an initialial commit
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Tue, 14 Oct 2025 09:34:59 +0000 (09:34 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Tue, 14 Oct 2025 09:34:59 +0000 (09:34 +0000)
developer/C/noop.lib.c [deleted file]
developer/cc/noop.lib.c [new file with mode: 0644]
developer/scratchpad/makefile-cc.deps [new file with mode: 0644]
developer/tool/clean [new file with mode: 0755]
developer/tool/env [new file with mode: 0644]
developer/tool/make [new file with mode: 0755]
developer/tool/makefile
developer/tool/release [new file with mode: 0755]
developer/tool/release_clean [new file with mode: 0755]
env_developer
rabit_kmod_seed.tar.gz [new file with mode: 0644]

diff --git a/developer/C/noop.lib.c b/developer/C/noop.lib.c
deleted file mode 100644 (file)
index f6c5586..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-// rabit_noop.c — Rabit no-op netfilter interposer (Debian 12/Bookworm)
-// Build: out-of-tree module. Load/unload to verify hook coverage.
-// Behavior: increments counters, returns NF_ACCEPT. No packet mutation.
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/version.h>
-#include <linux/skbuff.h>
-#include <linux/atomic.h>
-#include <linux/netdevice.h>
-#include <linux/netfilter.h>
-#include <linux/netfilter_ipv4.h>
-#include <linux/netfilter_ipv6.h>
-
-static atomic64_t cnt_v4_local_out  = ATOMIC_LONG_INIT(0);
-static atomic64_t cnt_v4_postroute  = ATOMIC_LONG_INIT(0);
-static atomic64_t cnt_v6_local_out  = ATOMIC_LONG_INIT(0);
-static atomic64_t cnt_v6_postroute  = ATOMIC_LONG_INIT(0);
-
-static unsigned int rabit_v4_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *st) {
-  if (st->hook == NF_INET_LOCAL_OUT)     atomic64_inc(&cnt_v4_local_out);
-  else if (st->hook == NF_INET_POST_ROUTING) atomic64_inc(&cnt_v4_postroute);
-  return NF_ACCEPT;
-}
-
-static unsigned int rabit_v6_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *st) {
-  if (st->hook == NF_INET_LOCAL_OUT)     atomic64_inc(&cnt_v6_local_out);
-  else if (st->hook == NF_INET_POST_ROUTING) atomic64_inc(&cnt_v6_postroute);
-  return NF_ACCEPT;
-}
-
-static struct nf_hook_ops rabit_ops[] = {
-  { .hook = rabit_v4_hook, .pf = NFPROTO_IPV4, .hooknum = NF_INET_LOCAL_OUT,   .priority = NF_IP_PRI_FIRST },
-  { .hook = rabit_v4_hook, .pf = NFPROTO_IPV4, .hooknum = NF_INET_POST_ROUTING,.priority = NF_IP_PRI_FIRST },
-  { .hook = rabit_v6_hook, .pf = NFPROTO_IPV6, .hooknum = NF_INET_LOCAL_OUT,   .priority = NF_IP6_PRI_FIRST },
-  { .hook = rabit_v6_hook, .pf = NFPROTO_IPV6, .hooknum = NF_INET_POST_ROUTING,.priority = NF_IP6_PRI_FIRST },
-};
-
-static int __init rabit_init(void) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
-  int ret = nf_register_net_hooks(&init_net, rabit_ops, ARRAY_SIZE(rabit_ops));
-#else
-  int ret = nf_register_hooks(rabit_ops, ARRAY_SIZE(rabit_ops));
-#endif
-  if (ret)
-    pr_err("rabit_noop: nf_register_* failed: %d\n", ret);
-  else
-    pr_info("rabit_noop: loaded (no-op)\n");
-  return ret;
-}
-
-static void __exit rabit_exit(void) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
-  nf_unregister_net_hooks(&init_net, rabit_ops, ARRAY_SIZE(rabit_ops));
-#else
-  nf_unregister_hooks(rabit_ops, ARRAY_SIZE(rabit_ops));
-#endif
-  pr_info("rabit_noop: unload stats v4(lo=%lld,po=%lld) v6(lo=%lld,po=%lld)\n",
-          (long long)atomic64_read(&cnt_v4_local_out),
-          (long long)atomic64_read(&cnt_v4_postroute),
-          (long long)atomic64_read(&cnt_v6_local_out),
-          (long long)atomic64_read(&cnt_v6_postroute));
-}
-
-module_init(rabit_init);
-module_exit(rabit_exit);
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Rabit");
-MODULE_DESCRIPTION("Rabit no-op netfilter interposer");
diff --git a/developer/cc/noop.lib.c b/developer/cc/noop.lib.c
new file mode 100644 (file)
index 0000000..f6c5586
--- /dev/null
@@ -0,0 +1,69 @@
+// rabit_noop.c — Rabit no-op netfilter interposer (Debian 12/Bookworm)
+// Build: out-of-tree module. Load/unload to verify hook coverage.
+// Behavior: increments counters, returns NF_ACCEPT. No packet mutation.
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/version.h>
+#include <linux/skbuff.h>
+#include <linux/atomic.h>
+#include <linux/netdevice.h>
+#include <linux/netfilter.h>
+#include <linux/netfilter_ipv4.h>
+#include <linux/netfilter_ipv6.h>
+
+static atomic64_t cnt_v4_local_out  = ATOMIC_LONG_INIT(0);
+static atomic64_t cnt_v4_postroute  = ATOMIC_LONG_INIT(0);
+static atomic64_t cnt_v6_local_out  = ATOMIC_LONG_INIT(0);
+static atomic64_t cnt_v6_postroute  = ATOMIC_LONG_INIT(0);
+
+static unsigned int rabit_v4_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *st) {
+  if (st->hook == NF_INET_LOCAL_OUT)     atomic64_inc(&cnt_v4_local_out);
+  else if (st->hook == NF_INET_POST_ROUTING) atomic64_inc(&cnt_v4_postroute);
+  return NF_ACCEPT;
+}
+
+static unsigned int rabit_v6_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *st) {
+  if (st->hook == NF_INET_LOCAL_OUT)     atomic64_inc(&cnt_v6_local_out);
+  else if (st->hook == NF_INET_POST_ROUTING) atomic64_inc(&cnt_v6_postroute);
+  return NF_ACCEPT;
+}
+
+static struct nf_hook_ops rabit_ops[] = {
+  { .hook = rabit_v4_hook, .pf = NFPROTO_IPV4, .hooknum = NF_INET_LOCAL_OUT,   .priority = NF_IP_PRI_FIRST },
+  { .hook = rabit_v4_hook, .pf = NFPROTO_IPV4, .hooknum = NF_INET_POST_ROUTING,.priority = NF_IP_PRI_FIRST },
+  { .hook = rabit_v6_hook, .pf = NFPROTO_IPV6, .hooknum = NF_INET_LOCAL_OUT,   .priority = NF_IP6_PRI_FIRST },
+  { .hook = rabit_v6_hook, .pf = NFPROTO_IPV6, .hooknum = NF_INET_POST_ROUTING,.priority = NF_IP6_PRI_FIRST },
+};
+
+static int __init rabit_init(void) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
+  int ret = nf_register_net_hooks(&init_net, rabit_ops, ARRAY_SIZE(rabit_ops));
+#else
+  int ret = nf_register_hooks(rabit_ops, ARRAY_SIZE(rabit_ops));
+#endif
+  if (ret)
+    pr_err("rabit_noop: nf_register_* failed: %d\n", ret);
+  else
+    pr_info("rabit_noop: loaded (no-op)\n");
+  return ret;
+}
+
+static void __exit rabit_exit(void) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
+  nf_unregister_net_hooks(&init_net, rabit_ops, ARRAY_SIZE(rabit_ops));
+#else
+  nf_unregister_hooks(rabit_ops, ARRAY_SIZE(rabit_ops));
+#endif
+  pr_info("rabit_noop: unload stats v4(lo=%lld,po=%lld) v6(lo=%lld,po=%lld)\n",
+          (long long)atomic64_read(&cnt_v4_local_out),
+          (long long)atomic64_read(&cnt_v4_postroute),
+          (long long)atomic64_read(&cnt_v6_local_out),
+          (long long)atomic64_read(&cnt_v6_postroute));
+}
+
+module_init(rabit_init);
+module_exit(rabit_exit);
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Rabit");
+MODULE_DESCRIPTION("Rabit no-op netfilter interposer");
diff --git a/developer/scratchpad/makefile-cc.deps b/developer/scratchpad/makefile-cc.deps
new file mode 100644 (file)
index 0000000..b485e73
--- /dev/null
@@ -0,0 +1,2 @@
+scratchpad/noop.lib.o: cc/noop.lib.c \
+ /home/Thomas/subu_data/developer/project/Linux/Rabbit/tool_shared/third_party/RT-project-share/release/make/RT_0.h
diff --git a/developer/tool/clean b/developer/tool/clean
new file mode 100755 (executable)
index 0000000..12aee9b
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+script_afp=$(realpath "${BASH_SOURCE[0]}")
+
+# input guards
+
+  env_must_be="developer/tool🖉/env"
+  if [ "$ENV" != "$env_must_be" ]; then
+    echo "$(script_fp):: error: must be run in the $env_must_be environment"
+    exit 1
+  fi
+
+set -e
+set -x
+
+
+cd "$REPO_HOME"/developer || exit 1
+
+# remove object files, deps file, library, and whatever else is on the scratchpad if anything
+  rm scratchpad/*.o $DEPFILE scratchpad/lib*.a   || true
+
+# remove built executables
+  rm -f machine/* || true
+
+set +x
+echo "$(script_fn) done."
diff --git a/developer/tool/env b/developer/tool/env
new file mode 100644 (file)
index 0000000..0b993ad
--- /dev/null
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+script_afp=$(realpath "${BASH_SOURCE[0]}")
+
diff --git a/developer/tool/make b/developer/tool/make
new file mode 100755 (executable)
index 0000000..dbd1f15
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+script_afp=$(realpath "${BASH_SOURCE[0]}")
+
+# input guards
+
+  env_must_be="developer/tool/env"
+  if [ "$ENV" != "$env_must_be" ]; then
+    echo "$(script_fp):: error: must be run in the $env_must_be environment"
+    exit 1
+  fi
+
+set -e
+set -x
+
+  cd "$REPO_HOME"/developer || exit 1
+  /bin/make -f tool/makefile $@
+
+set +x
+echo "$(script_fn) done."
index 42ab937..bc55904 100644 (file)
@@ -4,9 +4,8 @@ RT-INCOMMON:=$(REPO_HOME)/tool_shared/third_party/RT-project-share/release
 include $(RT-INCOMMON)/make/environment_RT_0
 
 # To compile the example directory uncomment the following assignments:
-SRCDIR_List=example
-CFLAGS+=-Icc🖉
-
+SRCDIR_List=cc
+CFLAGS+=-Icc
 
 CFLAGS+= -include "$(RT-INCOMMON)/make/RT_0.h"
 LINKFLAGS+= -l$(PROJECT)
diff --git a/developer/tool/release b/developer/tool/release
new file mode 100755 (executable)
index 0000000..582c84c
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+script_afp=$(realpath "${BASH_SOURCE[0]}")
+
+# before running this, make library is built and is in the scratchpad directory
+
+# input guards
+
+  env_must_be="developer/tool/env"
+  if [ "$ENV" != "$env_must_be" ]; then
+    echo "$(script_fp):: error: must be run in the $env_must_be environment"
+    exit 1
+  fi
+
+  cd "$REPO_HOME"/developer || exit 1
+
+  if [ ! -d scratchpad ]; then
+    echo "$(script_fp):: no scratchpad directory"
+    exit 1
+  fi
+
+#set -e
+#set -x
+
+  release_dir=$(release_dir)
+  mkdir -p ${release_dir}
+
+  install_file scratchpad/libN.a ${release_dir} "ug+r"  || true
+  install_file cc/*.lib.c ${release_dir} "ug+r"  || true
+  install_file cc/*.lib.c ${release_dir} "ug+r" || true
+
+#set +x
+echo "$(script_fn) done."
+
diff --git a/developer/tool/release_clean b/developer/tool/release_clean
new file mode 100755 (executable)
index 0000000..fc09a13
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+script_afp=$(realpath "${BASH_SOURCE[0]}")
+
+# before running this, make library is built and is in the scratchpad directory
+
+# input guards
+
+  env_must_be="developer/tool/env"
+  if [ "$ENV" != "$env_must_be" ]; then
+    echo "$(script_fp):: error: must be run in the $env_must_be environment"
+    exit 1
+  fi
+
+set -e
+set -x
+
+  cd "$REPO_HOME"/developer || exit 1
+
+  release_dir=$(release_dir)
+
+  if [ ! -d ${release_dir} ]; then
+    echo "$(script_fp):: no release directory: " ${release_dir}
+    exit 1
+  fi
+
+  rm_na -rf ${release_dir}/*
+
+set +x
+echo "$(script_fn) done."
+
index 8ee077f..892df91 100644 (file)
@@ -1,41 +1,42 @@
 #!/usr/bin/env bash
+
 script_afp=$(realpath "${BASH_SOURCE[0]}")
 if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
   echo "$script_afp:: This script must be sourced, not executed."
   exit 1
 fi
 
-# project environment is ROLE agnostic
-source tool_shared/bespoke/env
-export ROLE=developer
+# enter project environment
+#
+  source tool_shared/bespoke/env
 
 # setup tools
+#
+  export PYTHON_HOME="$REPO_HOME/tool_shared/third_party/python"
+  if [[ ":$PATH:" != *":$PYTHON_HOME/bin:"* ]]; then
+    export PATH="$PYTHON_HOME/bin:$PATH"
+  fi
 
-export PYTHON_HOME="$REPO_HOME/tool_shared/third_party/python"
-if [[ ":$PATH:" != *":$PYTHON_HOME/bin:"* ]]; then
-  export PATH="$PYTHON_HOME/bin:$PATH"
-fi
+  RT_gcc="$REPO_HOME/tool_shared/third_party/RT_gcc/release"
+  if [[ ":$PATH:" != *":$RT_gcc:"* ]]; then
+    export PATH="$RT_gcc:$PATH"
+  fi
 
-RT_gcc="$REPO_HOME/tool_shared/third_party/RT_gcc/release"
-if [[ ":$PATH:" != *":$RT_gcc:"* ]]; then
-  export PATH="$RT_gcc:$PATH"
-fi
+# enter the role environment
+#
+  export ROLE=developer
 
-# include the developer/tool directory and env
+  tool="$REPO_HOME/$ROLE/tool"
+  if [[ ":$PATH:" != *":$tool:"* ]]; then
+    export PATH="$tool:$PATH"
+  fi
 
-dev_tool=$REPO_HOME/developer/tool
-if [[ ":$PATH:" != *":$dev_tool:"* ]]; then
-  export PATH="$dev_tool:$PATH"
-fi
+  export ENV=$ROLE/tool/env
 
-if [[ -f "$ROLE/tool/env" ]]; then
-  source "$ROLE/tool/env"
-else
   cd "$ROLE"
-fi
-
-export ENV=$ROLE
-echo "in environmennt: $ENV"
-
-
-
+  if [[ -f "tool/env" ]]; then
+    source "tool/env"
+    echo "in environment: $ENV"
+  else
+    echo "not found: $ENV"
+  fi
diff --git a/rabit_kmod_seed.tar.gz b/rabit_kmod_seed.tar.gz
new file mode 100644 (file)
index 0000000..73480ed
Binary files /dev/null and b/rabit_kmod_seed.tar.gz differ