summaryrefslogtreecommitdiff
path: root/recipes/genlist
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/genlist
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/genlist')
-rw-r--r--recipes/genlist/files/Makefile25
-rw-r--r--recipes/genlist/files/genlist.c75
-rw-r--r--recipes/genlist/genlist.bb20
3 files changed, 120 insertions, 0 deletions
diff --git a/recipes/genlist/files/Makefile b/recipes/genlist/files/Makefile
new file mode 100644
index 0000000000..e5ef587d51
--- /dev/null
+++ b/recipes/genlist/files/Makefile
@@ -0,0 +1,25 @@
+#CC = gcc
+CFLAGS = -Wall -Os
+
+#VERSION = \"V0.10\"
+#CFLAGS += -DVERSION=$(VERSION)
+
+# for use with LIRC, uncomment the following two lines
+# CFLAGS += -DUSELIRC
+# LDFLAGS += -llirc_client
+
+#######################################################################
+
+SRC = genlist.c
+OBJ = genlist.o
+
+all: genlist
+
+genlist: $(OBJ)
+ $(CC) -s -o genlist $(OBJ) $(LDFLAGS)
+
+genlist.o: genlist.c
+
+
+clean:
+ rm -f $(OBJ) genlist
diff --git a/recipes/genlist/files/genlist.c b/recipes/genlist/files/genlist.c
new file mode 100644
index 0000000000..3170f36107
--- /dev/null
+++ b/recipes/genlist/files/genlist.c
@@ -0,0 +1,75 @@
+/* (Platform independant) IP lister (c)2000-1 Craig Cheetham
+ * Released under the GNU Licence. - Spread the source, not
+ * the binaries! (ahem fixed)
+ *
+ * E-Mail: craig_cheetham@yahoo.co.uk
+ *
+ */
+#include <stdio.h>
+#include <string.h>
+#include <netinet/in.h>
+
+union ipaddy
+{
+ unsigned char c_num[4];
+ unsigned long l_num;
+};
+
+int parse(char *string, char *dest)
+{
+ int i = 0;
+ unsigned long num;
+ char *p = string, *n;
+
+ strtok(p,".");
+
+ while(p && i<4) {
+ if((num = atol(p)) > 255) return 1;
+ dest[i++] = num;
+ p = strtok(0,".");
+ }
+
+ return 0;
+}
+
+int main (int argc, char **argv)
+{
+ union ipaddy source, dest;
+
+ if(argc < 3) {
+ printf("Platform independant IP lister, by Craig Cheetham (c)2000-1\n");
+ printf("===========================================================\n\n");
+ printf("Usage: %s <start ip> <end ip>\n\n", argv[0]);
+ printf("Examples:\n");
+ printf("\t\t%s 205 206\t\t\t# Class A scan\n", argv[0]);
+ printf("\t\t%s 205.214 205.215\t\t# Class B scan\n", argv[0]);
+ printf("\t\t%s 205.214.14 205.214.56\t# Class C scan\n", argv[0]);
+ exit(0);
+ }
+
+ source.l_num = dest.l_num = 0;
+
+ if(parse(argv[1], source.c_num)) {
+ fprintf(stderr, "Error: Source IP is jarg.\n");
+ return 0;
+ }
+
+ if(parse(argv[2], dest.c_num)) {
+ fprintf(stderr, "Error: Dest IP is jarg.\n");
+ return 0;
+ }
+
+ while(htonl(source.l_num) < htonl(dest.l_num)) {
+
+ if ((source.c_num[3]!=0) && (source.c_num[3]!=255))
+ printf("%u.%u.%u.%u\n",
+ source.c_num[0],
+ source.c_num[1],
+ source.c_num[2],
+ source.c_num[3]);
+
+ source.l_num = htonl(htonl(source.l_num)+1);
+ }
+
+ return 0;
+}
diff --git a/recipes/genlist/genlist.bb b/recipes/genlist/genlist.bb
new file mode 100644
index 0000000000..6c8695228b
--- /dev/null
+++ b/recipes/genlist/genlist.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "IP Address List Generator"
+SECTION = "utils"
+LICENSE = "GPL"
+PR = "r1"
+
+SRC_URI = "file://genlist.c \
+ file://Makefile"
+
+DEFAULT_PREFERENCE="-1"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ oe_runmake all
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 genlist ${D}${bindir}/
+}