LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-11-2009, 01:10 PM   #1
raja7799
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Rep: Reputation: 0
Serial data to IP packet conversion


Hi,
I have written a program which will read a serial data from RS232. I want prepare IP packet using this serial data. Can any body have any sort of program which will do Serial to IP conversion? Or do i need to prepare my self a IP packet using IPv4 header?
 
Old 11-12-2009, 08:22 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 13,822

Rep: Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369
Quote:
Originally Posted by raja7799 View Post
Hi,
I have written a program which will read a serial data from RS232. I want prepare IP packet using this serial data. Can any body have any sort of program which will do Serial to IP conversion? Or do i need to prepare my self a IP packet using IPv4 header?
You don't say what version/distro of Linux, or even what language you're working in, so it's hard to give you any help at all. However, you don't need to write a program to do this in Linux. Just pipe the serial port through netcat.
Code:
netcat <address or hostname> <port to send to> < /dev/ttyS0
Just replace the address and port information. Also, you may be using a different serial port (i.e. change the /dev/ttyS0 part). You can use the stty or setserial commands to change the parameters of the serial port (baud rate, parity, stop bits, etc.).
 
Old 11-14-2009, 02:25 PM   #3
raja7799
LQ Newbie
 
Registered: Sep 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up

Thanks for reply.
I'm using c language.
Actually i want to store the data what ever come from serial driver in a buffer. That data i have to send as ip packet. I had done with that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using USB<->Serial and serial gender changer to transmit data between computers JoeyAdams Linux - Hardware 4 04-17-2008 05:15 AM
Need USB to serial conversion in software only SiliconBadger Programming 3 02-24-2007 04:10 PM
how do i read the data in the packet that i have captured after packet capture? gajaykrishnan Programming 23 04-19-2006 05:09 AM
dump packet data to file, but no packet header Nathanael Linux - Networking 3 02-08-2006 10:27 AM
Serial to USB conversion in linux? mjwnijkamp Linux - Laptop and Netbook 0 05-14-2004 05:06 AM


All times are GMT -5. The time now is 06:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration