Version: 1
-Previous: f3e2e25503b335583dc8c21958868063564f5ece
-Head: 6648d39d72445202c5db4e03565deb81e70d4af1
+Previous: 887b3fce3a82a6823f5f030678fe73e701c8aa0d
+Head: fb1f5aec3c600cf11fb049eb2065da76ef73ccda
Applied:
logging: 549692c49922dce3911d97dcc6d0a2fc583ab5f7
acm_snoop: dd5542fbaa1c5a92367d0552ef3525d5ea0a4638
nodelay: 90b41e985e1f478cda3e4821709cb2ed5e27ee7f
acme_dest: b7ec8fce4adac1b6e970529e41ff1c936f4be27b
show_err: 47d8e33e2f36df1e3b163fcf7e8b0b56604fb944
- mult_dest: fb7bd236988a3506e7d98fd415d50d216a9e32f4
- refresh-temp: 6648d39d72445202c5db4e03565deb81e70d4af1
+ mult_dest: fb1f5aec3c600cf11fb049eb2065da76ef73ccda
Unapplied:
1.0.4: dc3f68d964641c9ffea14558d6a236c4216a89ae
Hidden:
Bottom: 32a7b8b2ffc23b410dc19c50a9bf68e149662635
-Top: 0218356f965d42baf54706b73dc0b362b11d4d6f
+Top: 16e9ccf5f15fb3b0f38df9b8f54df71a05372f49
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2010-12-07 09:39:52 -0800
---
+diff --git a/Makefile.am b/Makefile.am
+index 957b016..dfe955e 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -5,7 +5,7 @@ AM_CFLAGS = -g -Wall -D_GNU_SOURCE
+ bin_PROGRAMS = util/ib_acme
+ sbin_PROGRAMS = svc/ib_acm
+ svc_ib_acm_SOURCES = src/acm.c
+-util_ib_acme_SOURCES = src/acme.c linux/acme_linux.c src/libacm.c linux/libacm_linux.c
++util_ib_acme_SOURCES = src/acme.c linux/acme_linux.c src/libacm.c linux/libacm_linux.c src/parse.c
+ svc_ib_acm_CFLAGS = $(AM_CFLAGS)
+ util_ib_acme_CFLAGS = $(AM_CFLAGS)
+
diff --git a/man/ib_acme.1 b/man/ib_acme.1
index 56c49f0..de212fb 100644
--- a/man/ib_acme.1
if (!ret && make_addr)
ret = gen_addr();
+diff --git a/src/parse.c b/src/parse.c
+new file mode 100644
+index 0000000..e90fb09
+--- /dev/null
++++ b/src/parse.c
+@@ -0,0 +1,108 @@
++/*
++ * Copyright (c) 2009-2010 Intel Corporation. All rights reserved.
++ *
++ * This software is available to you under the OpenIB.org BSD license
++ * below:
++ *
++ * Redistribution and use in source and binary forms, with or
++ * without modification, are permitted provided that the following
++ * conditions are met:
++ *
++ * - Redistributions of source code must retain the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer.
++ *
++ * - Redistributions in binary form must reproduce the above
++ * copyright notice, this list of conditions and the following
++ * disclaimer in the documentation and/or other materials
++ * provided with the distribution.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
++ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++ * SOFTWARE.
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++static char *expand(char *basename, char *args, int *str_cnt, int *str_size)
++{
++ char buf[256];
++ char *str_buf = NULL;
++ char *token, *tmp;
++ int from, to, width;
++ int size = 0, cnt = 0;
++
++ token = strtok(args, ",");
++ do {
++ from = atoi(token);
++ tmp = index(token, '-');
++ if (tmp) {
++ to = atoi(tmp+1);
++ width = tmp - token;
++ } else {
++ to = from;
++ width = strlen(token);
++ }
++
++ while (from <= to) {
++ sprintf(buf, "%s%0*d", basename, width, from);
++ str_buf = realloc(str_buf, size + strlen(buf)+1);
++ strcpy(&str_buf[size], buf);
++
++ from++;
++ cnt++;
++ size += strlen(buf)+1;
++ }
++
++ token = strtok(NULL, ",");
++ } while (token);
++
++ *str_size = size;
++ *str_cnt = cnt;
++ return str_buf;
++}
++
++char **parse(char *args, int *count)
++{
++ char **ptrs;
++ char *str_buf, *cpy, *token, *next;
++ int cnt = 0, str_size = 0;
++ int i;
++
++ /* make a copy that strtok can modify */
++ cpy = malloc(strlen(args) + 1);
++ strcpy(cpy, args);
++
++ token = strtok(cpy, "[");
++ next = strtok(NULL, "]");
++ if (!next) {
++ str_size = strlen(token) + 1;
++ str_buf = malloc(str_size);
++ strcpy(str_buf, token);
++ cnt = 1;
++ } else {
++ str_buf = expand(cpy, next, &cnt, &str_size);
++ }
++
++ ptrs = malloc((sizeof str_buf * (cnt + 1)) + str_size);
++ memcpy(&ptrs[cnt + 1], str_buf, str_size);
++
++ ptrs[0] = (char*) &ptrs[cnt + 1];
++ for (i = 1; i < cnt; i++)
++ ptrs[i] = index(ptrs[i - 1], 0) + 1;
++ ptrs[i] = NULL;
++
++ free(cpy);
++ free(str_buf);
++
++ if (count)
++ *count = cnt;
++ return ptrs;
++}
+++ /dev/null
-Bottom: 0218356f965d42baf54706b73dc0b362b11d4d6f
-Top: 16e9ccf5f15fb3b0f38df9b8f54df71a05372f49
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2010-12-07 10:59:22 -0800
-
-Refresh of mult_dest
-
----
-
-diff --git a/Makefile.am b/Makefile.am
-index 957b016..dfe955e 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -5,7 +5,7 @@ AM_CFLAGS = -g -Wall -D_GNU_SOURCE
- bin_PROGRAMS = util/ib_acme
- sbin_PROGRAMS = svc/ib_acm
- svc_ib_acm_SOURCES = src/acm.c
--util_ib_acme_SOURCES = src/acme.c linux/acme_linux.c src/libacm.c linux/libacm_linux.c
-+util_ib_acme_SOURCES = src/acme.c linux/acme_linux.c src/libacm.c linux/libacm_linux.c src/parse.c
- svc_ib_acm_CFLAGS = $(AM_CFLAGS)
- util_ib_acme_CFLAGS = $(AM_CFLAGS)
-
-diff --git a/src/parse.c b/src/parse.c
-new file mode 100644
-index 0000000..e90fb09
---- /dev/null
-+++ b/src/parse.c
-@@ -0,0 +1,108 @@
-+/*
-+ * Copyright (c) 2009-2010 Intel Corporation. All rights reserved.
-+ *
-+ * This software is available to you under the OpenIB.org BSD license
-+ * below:
-+ *
-+ * Redistribution and use in source and binary forms, with or
-+ * without modification, are permitted provided that the following
-+ * conditions are met:
-+ *
-+ * - Redistributions of source code must retain the above
-+ * copyright notice, this list of conditions and the following
-+ * disclaimer.
-+ *
-+ * - Redistributions in binary form must reproduce the above
-+ * copyright notice, this list of conditions and the following
-+ * disclaimer in the documentation and/or other materials
-+ * provided with the distribution.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
-+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-+ * SOFTWARE.
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+static char *expand(char *basename, char *args, int *str_cnt, int *str_size)
-+{
-+ char buf[256];
-+ char *str_buf = NULL;
-+ char *token, *tmp;
-+ int from, to, width;
-+ int size = 0, cnt = 0;
-+
-+ token = strtok(args, ",");
-+ do {
-+ from = atoi(token);
-+ tmp = index(token, '-');
-+ if (tmp) {
-+ to = atoi(tmp+1);
-+ width = tmp - token;
-+ } else {
-+ to = from;
-+ width = strlen(token);
-+ }
-+
-+ while (from <= to) {
-+ sprintf(buf, "%s%0*d", basename, width, from);
-+ str_buf = realloc(str_buf, size + strlen(buf)+1);
-+ strcpy(&str_buf[size], buf);
-+
-+ from++;
-+ cnt++;
-+ size += strlen(buf)+1;
-+ }
-+
-+ token = strtok(NULL, ",");
-+ } while (token);
-+
-+ *str_size = size;
-+ *str_cnt = cnt;
-+ return str_buf;
-+}
-+
-+char **parse(char *args, int *count)
-+{
-+ char **ptrs;
-+ char *str_buf, *cpy, *token, *next;
-+ int cnt = 0, str_size = 0;
-+ int i;
-+
-+ /* make a copy that strtok can modify */
-+ cpy = malloc(strlen(args) + 1);
-+ strcpy(cpy, args);
-+
-+ token = strtok(cpy, "[");
-+ next = strtok(NULL, "]");
-+ if (!next) {
-+ str_size = strlen(token) + 1;
-+ str_buf = malloc(str_size);
-+ strcpy(str_buf, token);
-+ cnt = 1;
-+ } else {
-+ str_buf = expand(cpy, next, &cnt, &str_size);
-+ }
-+
-+ ptrs = malloc((sizeof str_buf * (cnt + 1)) + str_size);
-+ memcpy(&ptrs[cnt + 1], str_buf, str_size);
-+
-+ ptrs[0] = (char*) &ptrs[cnt + 1];
-+ for (i = 1; i < cnt; i++)
-+ ptrs[i] = index(ptrs[i - 1], 0) + 1;
-+ ptrs[i] = NULL;
-+
-+ free(cpy);
-+ free(str_buf);
-+
-+ if (count)
-+ *count = cnt;
-+ return ptrs;
-+}