LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
  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
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
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



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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:14 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration