blob: 972789309ae0122e21e851764ed56ceec8f36864 [file] [log] [blame]
Serge Bazanskid4438d62021-05-23 13:37:30 +02001package ident
2
3import (
4 "fmt"
5)
6
7// Request is an ident protocol request, as seen by the client or server.
8type Request struct {
9 // ClientPort is the port number on the client side of the indent protocol,
10 // ie. the port local to the ident client.
11 ClientPort uint16
12 // ServerPort is the port number on the server side of the ident protocol,
13 // ie. the port local to the ident server.
14 ServerPort uint16
15}
16
17// encode encodes ths Request as per RFC1413, including the terminating \r\n.
18func (r *Request) encode() []byte {
19 return []byte(fmt.Sprintf("%d,%d\r\n", r.ServerPort, r.ClientPort))
20}