directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Farkas" <z...@daxtechnologies.com>
Subject RE: [mina] help with implementing a syslog server with mina
Date Thu, 12 Jan 2006 16:59:41 GMT
This is not what I meant, I read the syslog documentation and it's more that clear...

The [mina] part I don not understand yet.

When I am trying to implement:

public MessageDecoderResult decodable( IoSession session, ByteBuffer in )
{
}

public MessageDecoderResult decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput
out ) throws Exception
{
}

When do I know that my "ByteBuffer in" contains a complete UDP packet message?

Let's say a UDP packet is received with: "<34>Jan 11 17:36:48 su: [ID 810491 auth.crit]
'su root' failed for maven on /dev/pts/1"


Now I assume that my ByteBuffer in can contain a part of the message like:

"<34>Jan 11 17:36:48 su: [ID 810491 auth.crit] 'su root' failed for "

Since the above message is a valid syslog message I never know if my bytebuffer contains a
complete message


Does [mina] guaratee that it will always put a complete UDP message in a buffer?

Any thoughts?

--zoly








-----Original Message-----
From: Kaspar Luethi [mailto:kaspar@humantools.ch] 
Sent: Thursday, January 12, 2006 11:48 AM
To: Apache Directory Developers List
Subject: Re: [mina] help with implementing a syslog server with mina

try the docs, it helps :)
looks like you never get more than 1 packet per message
(typically UDP max. packet size is > 1024).

The BSD Syslog Protocol
http://www.ietf.org/rfc/rfc3164.txt
Reliable Delivery for syslog
http://www.ietf.org/rfc/rfc3195.txt

----

4.1 syslog Message Parts

        The full format of a syslog message seen on the wire has three
        discernable parts.  The first part is called the PRI, the second part
        is the HEADER, and the third part is the MSG.  The total length of
        the packet MUST be 1024 bytes or less.

4.1.3 MSG Part of a syslog Packet

       The MSG part will fill the remainder of the syslog packet.  This will
       usually contain some additional information of the process that
       generated the message, and then the text of the message.  There is no
       ending delimiter to this part.


      If the relay adds a TIMESTAMP, or a TIMESTAMP and HOSTNAME, after the
      PRI part, then it MUST check that the total length of the packet is
      still 1024 bytes or less.  If the packet has been expanded beyond
      1024 bytes, then the relay MUST truncate the packet to be 1024 bytes.

----

kaspar



>I am trying to implement a syslog server with mina.
>
>The syslog protocol sends the messages in UDP packets (1 UDP pachet
>/ message), messages are variable in size
>
>Mina creates one Iosession / UDP packet received.
>
>Since the syslog message size is not standard and for UDP transport
>Session open and close is not called (for IOProtocolAdapter) I
>cannot know when I have the complete message, since I assume the
>buffer can countain a partial UDP message Š
>
>Can anybody give me a hint how to implement this server?
>
>Right now I am trying to implement a MessageDecoder, but again I
>don't know when I have a complete message in the buffer !!!
>
>thanks
>
>--zoly
-- 
---------------------------------------------
  http://www.humantools.com


Mime
View raw message