LinuxQuestions.org
Help answer threads with 0 replies.
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 06-28-2011, 06:11 AM   #1
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Rep: Reputation: 47
'construct' a packet?


we have a minor issue with time synchronization in proprietary equipment.
the client needs to synchronize time with server, but not using NTP.
it is not very important so doesn't need to be done often.

the problem is that it won't synchronize. I can see the server is sending tcp packet with date&time, but the client ignores it.
I suspect the problem is in format (manual specifies there are two possible options like MM: DD: YYYY and so on, but server seems to use some other)

Is there an easy way to run some program in Linux Debian, to send that simple packet with correct date?

(the IP address of server can be configured in client)
 
Old 06-28-2011, 05:34 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
You could muck with a telnet server (bad), netcat, a web server CGI or use something that might be already there, is configurable, has builtin ACLs etc, etc like Xinetd. For example a simple service configuration like:
Code:
]$ cat /etc/xinetd.d/timetell
# default: on
# description: 
service timetell 
{
        disable = no
        socket_type     = stream
        protocol        = tcp
        port            = 9999
        type            = UNLISTED
        wait            = no
        user            = root
        server          = /bin/date
        server_args     = +%Y:%m:%d
        log_on_failure  += USERID
        only_from       = 127.0.0.1 192.168.0.0/16
}
...would return just "fullyear:month:day" plain text when polled on port TCP/9999.
 
1 members found this post helpful.
Old 06-30-2011, 08:08 AM   #3
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Original Poster
Rep: Reputation: 47
thanks.
so, I need to install xinetd in debian, but it conflicts with inet-superserver (openbsd-inetd).

what to do?

edit: can it be done with inetd?

Last edited by qrange; 06-30-2011 at 08:29 AM.
 
Old 06-30-2011, 02:16 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Sure, can't see why not.
 
Old 07-01-2011, 01:42 AM   #5
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,061

Original Poster
Rep: Reputation: 47
er, could you tell me how to modify your example for inetd?
I'm somewhat clueless about it, never used it before in such way.
thanks.

edit: this has been solved, (the problem was indeed in format) I found the instructions on google and edited /etc/inetd.conf
works great

Last edited by qrange; 07-21-2011 at 01:59 AM.
 
  


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
help me construct an rpm command pbhat Linux - Software 3 06-13-2008 08:07 AM
Streamlining this awk construct uncle-c Linux - General 2 10-31-2007 08:39 AM
how to construct a compiler dayalan_cse Programming 10 08-31-2007 05:28 PM
Construct a Service amirsarb Programming 2 06-01-2007 09:58 AM
C++: construct object at certain address addy86 Programming 18 07-22-2006 05:17 PM

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

All times are GMT -5. The time now is 04:39 PM.

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