5

i want to write a program using multi-threading, raw sockets, to scan the ports in python i have a C code for injection of raw socket. i want to perform a ACK scan so need a raw socket.

So please help me.

thank you

asked Oct 19, 2010 at 12:52
1

2 Answers 2

4

Please check out Cython. It makes it very easy to wrap C code.

This is adapted from the documentation on calling external C functions:

cdef extern from "math.h":
 double sin(double)
def pysin(x):
 return sin(x)

You could then call pysin from the compiled module like a normal Python module.

answered Oct 19, 2010 at 12:58
Sign up to request clarification or add additional context in comments.

Comments

0

I would definitely go with boost.python, which provides even cleaner wrappers. If you dislike the idea of using C++, then Cython is a good alternative.

answered Oct 19, 2010 at 13:01

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.