LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-25-2010, 09:14 PM   #1
fjkum
Member
 
Registered: Feb 2006
Posts: 40

Rep: Reputation: 15
Send a UDP Syslog packet with Source Port set to 514


Hi,

I am trying to generate a UDP syslog packet from my C application. But I am facing a problem with a Cisco Router ACE that does not like the Source Port being '0' and thus drops the packet.

How can I specify the Source Port in the UDP header to '514' as stated in RFC3164 (Section 2: Transport Layer Protocol)?

"It is RECOMMENDED that the source port also be 514 to
indicate that the message is from the syslog process of the sender"
 
Old 01-26-2010, 03:53 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
After you create your socket, use bind() to set your port. Then continue with your code.
 
  


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
"Firewall UDP Packet Source Port 53 Ruleset Bypass" fantasygoat Linux - Security 8 12-14-2009 02:16 PM
Syslog not binding to 514 awilisch Linux - Server 2 06-28-2008 07:54 AM
How to specify source port when sending UDP packet socialjazz Programming 4 09-19-2006 08:15 PM
Testing message to SyslogD UDP port 514. Zepiroth Linux - Server 0 09-01-2006 12:13 AM
Is it possible to set the udp packet size for a DNS query in BIND 9.2.1?? Paul_Randle Linux - Networking 0 10-17-2005 08:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:43 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