Forum: GNU Radio tunnel.py

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.