Skip to contentSkip to conversation

binding ax devices to TCP ports?

DISCUSSION ozgun erdogan 2 participants 2 messages Dec 3, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

I read the kissattach code as I need to write some code which binds a TCP port to an ax network device. That is, TCP packets coming from a specific port will be read from ax1. (with listen for example.)

I know some sockets stuff, but am not good in Linux Ham, and couldn't figure out how kissattach creates a KISS networks device. I looked through the readconfig(char *) function, but that seems to only initialize certain parameters. I couldn't figure out how the device is created, nor how the serial port is associated with the KISS networks device. I've been surfing the web to find some information on creating KISS network devices and how to write data to them, but couldn't succeed.

So, could you make any comments on how struct ifreq is used, or the way the KISS device is created? (also a link to some documentation would be very useful)

Thanks,

Ozgun.

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus

#1 lore raw
Quoted 3 lines · ozgun erdogan

I read the kissattach code as I need to write some code which binds a TCP port to an ax network device. That is, TCP packets coming from a specific port will be read from ax1. (with listen for example.)

I think you have to be a bit more specific about what you are trying to do. TCP is a transport layer protocol and TCP ports are a concept related to TCP, of course. A network device is quite a few steps below that in the OSI model (assuming for a minute that OSI model can be used to describe the Linux networking stack). Binding a TCP port to an ax or whatever network device doesn't really make much sense, to me anyway.

You mention the "listen" program. Could whatever you are doing be done simply by modifying "listen" ?

Quoted 3 lines

So, could you make any comments on how struct ifreq is used, or the way the KISS device is created? (also a link to some documentation would be very useful)

The essential thing in kissattach is the ioctl(..., TIOCSETD, ...) call. That tells the kernel to switch the serial port to a special networking mode (it sets a "line discipline" to it). The kernel then magically creates the network device for you. The rest of kissattach is mostly setting up some parameters like HW address, IP address etc. While these are of course important, the real work is done in that ioctl() call.

Signature · 3 lines
Tomi Manninen           Internet:  [email protected]
OH2BNS                  AX.25:     [email protected]
KP20ME04                Amprnet:   [email protected]