l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
December 2: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
Page last updated:
2003 May 22 12:40

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] network blinken lights experiment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] network blinken lights experiment



thanks for the ideas--

i found a simple way to do it using ngrep and awk!

ngrep -q -D | awk -f netled.awk > /dev/ttyS0

netled.awk consists of

/:80/ { print 0 }
/:21/ { print 1 }
/:25/ { print 2 }
/:995/ { print 3 }
/:22/ { print 4 }
/192\.168\.10\.60/ {print 5}


seems to work.. however, ngrep doesn't always report the packets as soon as
they occur....need to figure out how to make it more responsive..

here is a quick picture of it in action:
http://iici.no-ip.org/~dylan/netled/netled2.jpg


-dylan

on 03.5.19 3:00 PM, wenk@praxis.homedns.org at wenk@praxis.homedns.org was
reported to have writen:

> I wonder if using tcpdump would be the best way of doing this...
> 
> And yes, you could do the whole thing via perl using perl regular
> expressions.  Either do a open INBUF, "tail -f <file> |"; or maybe
> there is a way to do it completely in perl.  I haven't had to do this
> and the cookbook is not handy at the moment... You can then have perl
> open the serial port, and send the byte chunk that way.  IE, A basic
> script would be: 
> 
> open INBUF, "tail -f <file> |";
> 
> while (<INBUF>) {
> 
> if (/My Happy Regexp/) {
> 
> open OUT, "/dev/ttyS0";
> print OUT, "MYBYTE\n";
> close OUT;
> }
> }
> 
> 
> I didn't run that thru the interpreter, so I may have done something
> boneheaded in my syntax.
> 
> Back to tcpdump, if you have netfilter logging in your kernel, you
> can always enable logging that way.  I'm not sure if that's the way
> you want to go. 
> 
> Mike
> 
> 
> 

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!