Re: Sending a broadcast message using raw sockets

2013-01-22 Thread peter
Yes, raw sockets need admin privileges, I knew that. The app I'm writing runs as root so that's not a problem. It runs during the %pre script stage of a kickstart controlled install. On Tuesday, January 22, 2013 1:58:07 PM UTC-8, Rob Williscroft wrote: > Try > > s = socket.socket( socket

Re: Sending a broadcast message using raw sockets

2013-01-22 Thread Rob Williscroft
Peter Steele wrote in news:96947c45-f16b-4e97-b055-edc1241ee...@googlegroups.com in comp.lang.python: > I just tried running you code, and the "sendto" call fails with > "Network is unreachable". That's what I expected, based on other tests > I've done. That's why I was asking about how to do raw

Re: Sending a broadcast message using raw sockets

2013-01-22 Thread Peter Steele
Actually, I used to teach C, so yeah, I know it pretty well. :-) Scapy is a possibility, I just need to add it to my environment (which doesn't have a C compiler). I can jury rig something though. On Tuesday, January 22, 2013 1:19:14 PM UTC-8, Chris Angelico wrote: > On Wed, Jan 23, 2013 at 4:57

Re: Sending a broadcast message using raw sockets

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 4:57 AM, Peter Steele wrote: > In fact, I have used scapy in the past, but I am working in a restricted > environment and don't have this package available. It provides tones more > than I really need anyway, and I figured a simple raw socket send/receive > can't be *tha

Re: Sending a broadcast message using raw sockets

2013-01-22 Thread Peter Steele
In fact, I have used scapy in the past, but I am working in a restricted environment and don't have this package available. It provides tones more than I really need anyway, and I figured a simple raw socket send/receive can't be *that* hard. I may have to reverse engineer some C code, such as d

Re: Sending a broadcast message using raw sockets

2013-01-22 Thread Corey LeBleu
If you don't *have* to use the actual socket library, you might want to have a look at scapy. It's a packet manipulation program/library. It might make things a little easier. http://www.secdev.org/projects/scapy/ On Jan 22, 2013 9:17 AM, "Peter Steele" wrote: > I just tried running you code,

Re: Sending a broadcast message using raw sockets

2013-01-22 Thread Peter Steele
I just tried running you code, and the "sendto" call fails with "Network is unreachable". That's what I expected, based on other tests I've done. That's why I was asking about how to do raw sockets, since tools like dhclient use raw sockets to do what they do. It can clearly be duplicated in Pyt

Re: Sending a broadcast message using raw sockets

2013-01-22 Thread Rob Williscroft
Peter Steele wrote in news:0c2b3482-df46-4324-8bf9-2c45d3f6b...@googlegroups.com in comp.lang.python: > On Monday, January 21, 2013 1:10:06 AM UTC-8, Rob Williscroft wrote: >> Peter Steele wrote in >> >> news:f37ccb35-8439-42cd-a063-962249b44...@googlegroups.com in >> >> comp.lang.python: >>

Re: Sending a broadcast message using raw sockets

2013-01-21 Thread Peter Steele
On Monday, January 21, 2013 1:10:06 AM UTC-8, Rob Williscroft wrote: > Peter Steele wrote in > > news:f37ccb35-8439-42cd-a063-962249b44...@googlegroups.com in > > comp.lang.python: > > > I want to write a program in Python that sends a broadcast message > > using raw sockets. The system where t

Re: Sending a broadcast message using raw sockets

2013-01-21 Thread Rob Williscroft
Peter Steele wrote in news:f37ccb35-8439-42cd-a063-962249b44...@googlegroups.com in comp.lang.python: > I want to write a program in Python that sends a broadcast message > using raw sockets. The system where this program will run has no IP or > default route defined, hence the reason I need to u

Sending a broadcast message using raw sockets

2013-01-18 Thread Peter Steele
I want to write a program in Python that sends a broadcast message using raw sockets. The system where this program will run has no IP or default route defined, hence the reason I need to use a broadcast message. I've done some searches and found some bits and pieces about using raw sockets in