This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Telnet support for eCos - Interfacing Telnet / Remote Console to File IO


Hi,

My target hardware has a serial port that's used for configuration by
the user and debugging by myself. The simple CLI/MMI that runs on it is
written using fprintf / fgetc (using fileio to "redirect" data to my
serial i/o driver). We want to access this remotely over the Ethernet
interface on our target so telnet would seem to be the best approach
here. A couple of questions:

	- is there a port of telnet to eCos? I've seen lots of messages
in the discussion list asking about telnet and people saying they were
doing it - but has it actually happened? Is there any code out there -
complete or not?

	- if not what is the best way for me to interface telnet between
the network stack sockets and the file system?
	It's fairly easy to implement a "server" thread that sits and
listens on port 23 for an incoming connection. The telnet state machine
(processing the IAC escape mechanism etc) is also pretty easy to
implement. But it's the gluing it all together (as usual) that's more
difficult.
	Assuming that I can write a "server" thread that listens for
connections and creates a new socket on accept. I can now pass this
socket id to my telnet state machine that can process any data that is
written to the socket or read from the socket. But how does this telnet
state machine provide a File io interface. Can I dynamically create a
FILE that my CLI can use for i/o operations?
	There seem to be two ways (probably more?):
	1.	using the device driver api - I could (statically)
create say 2 telnet devices ("/dev/telnet1" and "/dev/telnet2"). My CLI
opens one of these "files" for its io operation and I write a new serial
device driver that actually performs my telnet state machine and
interfaces to the appropriate socket. Sounds like it should work - I
think I'd be limited to a fixed number of telnet sessions - but it's a
bit naff.
	2.	create a new file system, in the same way as "ramfs" /
"romfs", called "telnetfs". My "server" thread should then be able to
create a new telnet "file" when a connection is established which my CLI
can use for its file io. But I'd have to implement entire file system
handling required by eCos - which sounds a big job and a bit daunting to
me? Does anybody have a feel for how easy this would be? I guess I can
use devfs or ramfs as examples of what need doing. It seems a better way
than 1) but a lot more work.


	Does any of this make sense to anybody? Or (even better) has
anybody interfaced Telnet to eCos Fileio package?


	Thanks
		Dave Webster


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]