Forum: GNU Radio tunnel.py

2253f229de2a90490d242cd781878d37?d=identicon&s=25 Jay Prakash (Guest)
on 2013-05-30 18:28
(Received via mailing list)
Hi!,

I was going through tunnel.py code.

 can some one explain the function and particularly the
tune_device_filename significance?
///////////////////////////////////////
def open_tun_interface(tun_device_filename):
    from fcntl import ioctl

    mode = IFF_TAP | IFF_NO_PI
    TUNSETIFF = 0x400454ca

    tun = os.open(tun_device_filename, os.O_RDWR)
    ifs = ioctl(tun, TUNSETIFF, struct.pack("16sH", "gr%d", mode))
    ifname = ifs[:16].strip("\x00")
    return (tun, ifname)

////////////////////////////////////////////



Jay Prakash
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.