go-hep.org/x/hep@v0.38.1/xrootd/xrdproto/decrypt/decrypt.go (about)

     1  // Copyright ©2018 The go-hep Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Package decrypt contains the types related to the decrypt request.
     6  // See xrootd protocol specification (http://xrootd.org/doc/dev45/XRdv310.pdf, p. 43) for more details.
     7  package decrypt // import "go-hep.org/x/hep/xrootd/xrdproto/decrypt"
     8  
     9  import (
    10  	"go-hep.org/x/hep/xrootd/internal/xrdenc"
    11  )
    12  
    13  // RequestID is the id of the request, it is sent as part of message.
    14  // See xrootd protocol specification for details: http://xrootd.org/doc/dev45/XRdv310.pdf, 2.3 Client Request Format.
    15  const RequestID uint16 = 3030
    16  
    17  // Request holds the decrypt request parameters.
    18  type Request struct {
    19  	_ [16]byte
    20  	_ int32
    21  }
    22  
    23  // ReqID implements xrdproto.Request.ReqID.
    24  func (req *Request) ReqID() uint16 { return RequestID }
    25  
    26  // ShouldSign implements xrdproto.Request.ShouldSign.
    27  func (*Request) ShouldSign() bool { return false }
    28  
    29  // MarshalXrd implements xrdproto.Marshaler.
    30  func (o Request) MarshalXrd(w *xrdenc.WBuffer) error {
    31  	w.Next(16)
    32  	w.WriteI32(0)
    33  	return nil
    34  }
    35  
    36  // UnmarshalXrd implements xrdproto.Unmarshaler.
    37  func (o *Request) UnmarshalXrd(r *xrdenc.RBuffer) error {
    38  	r.Skip(16)
    39  	_ = r.ReadI32()
    40  	return nil
    41  }