aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-18 15:35:24 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-18 15:35:24 +0000
commit62a2916d1ecd49104d89afca16d4de978c016dbe (patch)
treee4d99d2e6ccdd128517dc3608231443cb8c4a079 /package/network/utils
parent1e23f90c158f91b66d87bf0467f1987d81165288 (diff)
downloadmaster-187ad058-62a2916d1ecd49104d89afca16d4de978c016dbe.tar.gz
master-187ad058-62a2916d1ecd49104d89afca16d4de978c016dbe.tar.bz2
master-187ad058-62a2916d1ecd49104d89afca16d4de978c016dbe.zip
br2684ctl: add support for notifying nas* bringup via a script
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48320 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/utils')
-rw-r--r--package/network/utils/linux-atm/patches/500-br2684ctl_script.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/package/network/utils/linux-atm/patches/500-br2684ctl_script.patch b/package/network/utils/linux-atm/patches/500-br2684ctl_script.patch
new file mode 100644
index 0000000000..e5481c8d17
--- /dev/null
+++ b/package/network/utils/linux-atm/patches/500-br2684ctl_script.patch
@@ -0,0 +1,54 @@
+--- a/src/br2684/br2684ctl.c
++++ b/src/br2684/br2684ctl.c
+@@ -1,3 +1,4 @@
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+@@ -43,6 +44,7 @@ struct br2684_params {
+
+
+ int lastsock, lastitf;
++static char *up_script;
+
+
+ void fatal(const char *str, int err)
+@@ -185,6 +187,8 @@ int assign_vcc(char *astr, int encap, in
+
+ void start_interface(struct br2684_params* params)
+ {
++ char *cmd;
++
+ if (params->astr==NULL) {
+ syslog(LOG_ERR, "Required ATM parameters not specified.");
+ exit(1);
+@@ -193,13 +197,18 @@ void start_interface(struct br2684_param
+ create_br(params->itfnum, params->payload);
+ assign_vcc(params->astr, params->encap, params->payload, params->sndbuf,
+ params->reqqos);
++ if (up_script) {
++ asprintf(&cmd, "%s nas%d", up_script, lastitf);
++ system(cmd);
++ free(cmd);
++ }
+ }
+
+
+ void usage(char *s)
+ {
+ printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-p 0|1] "
+- "[-a [itf.]vpi.vci]*]*\n", s);
++ "[-a [itf.]vpi.vci]*]* [-S script]\n", s);
+ printf(" encapsulations: 0=llc, 1=vcmux\n payloads: 0=routed, 1=bridged\n");
+ exit(1);
+ }
+@@ -258,6 +267,9 @@ int main (int argc, char **argv)
+ params.sndbuf=8192;
+ }
+ break;
++ case 'S':
++ up_script = optarg;
++ break;
+ case 'p': /* payload type: routed (0) or bridged (1) */
+ #ifdef BR2684_FLAG_ROUTED
+ params.payload = atoi(optarg);