Skip to content

Commit 7495ca4

Browse files
committed
added to scanner stub
1 parent 981f699 commit 7495ca4

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

RCat.rkt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,32 @@
3737
;
3838

3939
(define (RCat targets ports protocols)
40-
(if (regexp-match? #rx".*-.*" targets) "yes" "no"))
40+
(if (regexp-match? #rx".*-.*" targets)
41+
(ips->machines targets ports protocols)
42+
(machine targets ports protocols))
43+
)
44+
45+
(define (ips->machines targets ports protocols)
46+
"stub")
47+
(define (range->list targets)
48+
; convert from range of ips to a list of ips
49+
; 192.168.1-15 -> '("192.168.1.1" ... "192.168.1.15")
50+
(let*((range(regexp-split #rx"-" targets))
51+
(three-octets (regexp-split #rx"//." (car range)))
52+
(start (caddr three-octets))
53+
(end (cadr range))
54+
55+
)
56+
three-octets
57+
))
58+
59+
; from ps3c
60+
(define (enum-range-i a b)
61+
(define (enum-range-halper a b total)
62+
(if (> a b)
63+
total
64+
(enum-range-halper (add1 a) b (append total (list a) ))))
65+
(enum-range-halper a b '()))
4166

4267
(define (machine ips ports protocols)
4368
(define open-tcp '())

0 commit comments

Comments
 (0)