github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/ikev2/ikev2.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  // versions:
     3  //  binapi-generator: v0.10.0-dev
     4  //  VPP:              23.10-rc0~170-g6f1548434
     5  // source: plugins/ikev2.api.json
     6  
     7  // Package ikev2 contains generated bindings for API file ikev2.api.
     8  //
     9  // Contents:
    10  // - 50 messages
    11  package ikev2
    12  
    13  import (
    14  	ikev2_types "github.com/networkservicemesh/govpp/binapi/ikev2_types"
    15  	interface_types "github.com/networkservicemesh/govpp/binapi/interface_types"
    16  	ip_types "github.com/networkservicemesh/govpp/binapi/ip_types"
    17  	api "go.fd.io/govpp/api"
    18  	codec "go.fd.io/govpp/codec"
    19  )
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the GoVPP api package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // GoVPP api package needs to be updated.
    25  const _ = api.GoVppAPIPackageIsVersion2
    26  
    27  const (
    28  	APIFile    = "ikev2"
    29  	APIVersion = "1.0.1"
    30  	VersionCrc = 0x8eb2437c
    31  )
    32  
    33  // Child SA details
    34  //   - retval - return code
    35  //   - child_sa - child SA data
    36  //
    37  // Ikev2ChildSaDetails defines message 'ikev2_child_sa_details'.
    38  // InProgress: the message form may change in the future versions
    39  type Ikev2ChildSaDetails struct {
    40  	Retval  int32                    `binapi:"i32,name=retval" json:"retval,omitempty"`
    41  	ChildSa ikev2_types.Ikev2ChildSa `binapi:"ikev2_child_sa,name=child_sa" json:"child_sa,omitempty"`
    42  }
    43  
    44  func (m *Ikev2ChildSaDetails) Reset()               { *m = Ikev2ChildSaDetails{} }
    45  func (*Ikev2ChildSaDetails) GetMessageName() string { return "ikev2_child_sa_details" }
    46  func (*Ikev2ChildSaDetails) GetCrcString() string   { return "ff67741f" }
    47  func (*Ikev2ChildSaDetails) GetMessageType() api.MessageType {
    48  	return api.ReplyMessage
    49  }
    50  
    51  func (m *Ikev2ChildSaDetails) Size() (size int) {
    52  	if m == nil {
    53  		return 0
    54  	}
    55  	size += 4      // m.Retval
    56  	size += 4      // m.ChildSa.SaIndex
    57  	size += 4      // m.ChildSa.ChildSaIndex
    58  	size += 4      // m.ChildSa.ISpi
    59  	size += 4      // m.ChildSa.RSpi
    60  	size += 1 * 64 // m.ChildSa.Keys.SkD
    61  	size += 1      // m.ChildSa.Keys.SkDLen
    62  	size += 1 * 64 // m.ChildSa.Keys.SkAi
    63  	size += 1      // m.ChildSa.Keys.SkAiLen
    64  	size += 1 * 64 // m.ChildSa.Keys.SkAr
    65  	size += 1      // m.ChildSa.Keys.SkArLen
    66  	size += 1 * 64 // m.ChildSa.Keys.SkEi
    67  	size += 1      // m.ChildSa.Keys.SkEiLen
    68  	size += 1 * 64 // m.ChildSa.Keys.SkEr
    69  	size += 1      // m.ChildSa.Keys.SkErLen
    70  	size += 1 * 64 // m.ChildSa.Keys.SkPi
    71  	size += 1      // m.ChildSa.Keys.SkPiLen
    72  	size += 1 * 64 // m.ChildSa.Keys.SkPr
    73  	size += 1      // m.ChildSa.Keys.SkPrLen
    74  	size += 1      // m.ChildSa.Encryption.TransformType
    75  	size += 2      // m.ChildSa.Encryption.TransformID
    76  	size += 2      // m.ChildSa.Encryption.KeyLen
    77  	size += 2      // m.ChildSa.Encryption.KeyTrunc
    78  	size += 2      // m.ChildSa.Encryption.BlockSize
    79  	size += 1      // m.ChildSa.Encryption.DhGroup
    80  	size += 1      // m.ChildSa.Integrity.TransformType
    81  	size += 2      // m.ChildSa.Integrity.TransformID
    82  	size += 2      // m.ChildSa.Integrity.KeyLen
    83  	size += 2      // m.ChildSa.Integrity.KeyTrunc
    84  	size += 2      // m.ChildSa.Integrity.BlockSize
    85  	size += 1      // m.ChildSa.Integrity.DhGroup
    86  	size += 1      // m.ChildSa.Esn.TransformType
    87  	size += 2      // m.ChildSa.Esn.TransformID
    88  	size += 2      // m.ChildSa.Esn.KeyLen
    89  	size += 2      // m.ChildSa.Esn.KeyTrunc
    90  	size += 2      // m.ChildSa.Esn.BlockSize
    91  	size += 1      // m.ChildSa.Esn.DhGroup
    92  	return size
    93  }
    94  func (m *Ikev2ChildSaDetails) Marshal(b []byte) ([]byte, error) {
    95  	if b == nil {
    96  		b = make([]byte, m.Size())
    97  	}
    98  	buf := codec.NewBuffer(b)
    99  	buf.EncodeInt32(m.Retval)
   100  	buf.EncodeUint32(m.ChildSa.SaIndex)
   101  	buf.EncodeUint32(m.ChildSa.ChildSaIndex)
   102  	buf.EncodeUint32(m.ChildSa.ISpi)
   103  	buf.EncodeUint32(m.ChildSa.RSpi)
   104  	buf.EncodeBytes(m.ChildSa.Keys.SkD, 64)
   105  	buf.EncodeUint8(m.ChildSa.Keys.SkDLen)
   106  	buf.EncodeBytes(m.ChildSa.Keys.SkAi, 64)
   107  	buf.EncodeUint8(m.ChildSa.Keys.SkAiLen)
   108  	buf.EncodeBytes(m.ChildSa.Keys.SkAr, 64)
   109  	buf.EncodeUint8(m.ChildSa.Keys.SkArLen)
   110  	buf.EncodeBytes(m.ChildSa.Keys.SkEi, 64)
   111  	buf.EncodeUint8(m.ChildSa.Keys.SkEiLen)
   112  	buf.EncodeBytes(m.ChildSa.Keys.SkEr, 64)
   113  	buf.EncodeUint8(m.ChildSa.Keys.SkErLen)
   114  	buf.EncodeBytes(m.ChildSa.Keys.SkPi, 64)
   115  	buf.EncodeUint8(m.ChildSa.Keys.SkPiLen)
   116  	buf.EncodeBytes(m.ChildSa.Keys.SkPr, 64)
   117  	buf.EncodeUint8(m.ChildSa.Keys.SkPrLen)
   118  	buf.EncodeUint8(m.ChildSa.Encryption.TransformType)
   119  	buf.EncodeUint16(m.ChildSa.Encryption.TransformID)
   120  	buf.EncodeUint16(m.ChildSa.Encryption.KeyLen)
   121  	buf.EncodeUint16(m.ChildSa.Encryption.KeyTrunc)
   122  	buf.EncodeUint16(m.ChildSa.Encryption.BlockSize)
   123  	buf.EncodeUint8(m.ChildSa.Encryption.DhGroup)
   124  	buf.EncodeUint8(m.ChildSa.Integrity.TransformType)
   125  	buf.EncodeUint16(m.ChildSa.Integrity.TransformID)
   126  	buf.EncodeUint16(m.ChildSa.Integrity.KeyLen)
   127  	buf.EncodeUint16(m.ChildSa.Integrity.KeyTrunc)
   128  	buf.EncodeUint16(m.ChildSa.Integrity.BlockSize)
   129  	buf.EncodeUint8(m.ChildSa.Integrity.DhGroup)
   130  	buf.EncodeUint8(m.ChildSa.Esn.TransformType)
   131  	buf.EncodeUint16(m.ChildSa.Esn.TransformID)
   132  	buf.EncodeUint16(m.ChildSa.Esn.KeyLen)
   133  	buf.EncodeUint16(m.ChildSa.Esn.KeyTrunc)
   134  	buf.EncodeUint16(m.ChildSa.Esn.BlockSize)
   135  	buf.EncodeUint8(m.ChildSa.Esn.DhGroup)
   136  	return buf.Bytes(), nil
   137  }
   138  func (m *Ikev2ChildSaDetails) Unmarshal(b []byte) error {
   139  	buf := codec.NewBuffer(b)
   140  	m.Retval = buf.DecodeInt32()
   141  	m.ChildSa.SaIndex = buf.DecodeUint32()
   142  	m.ChildSa.ChildSaIndex = buf.DecodeUint32()
   143  	m.ChildSa.ISpi = buf.DecodeUint32()
   144  	m.ChildSa.RSpi = buf.DecodeUint32()
   145  	m.ChildSa.Keys.SkD = make([]byte, 64)
   146  	copy(m.ChildSa.Keys.SkD, buf.DecodeBytes(len(m.ChildSa.Keys.SkD)))
   147  	m.ChildSa.Keys.SkDLen = buf.DecodeUint8()
   148  	m.ChildSa.Keys.SkAi = make([]byte, 64)
   149  	copy(m.ChildSa.Keys.SkAi, buf.DecodeBytes(len(m.ChildSa.Keys.SkAi)))
   150  	m.ChildSa.Keys.SkAiLen = buf.DecodeUint8()
   151  	m.ChildSa.Keys.SkAr = make([]byte, 64)
   152  	copy(m.ChildSa.Keys.SkAr, buf.DecodeBytes(len(m.ChildSa.Keys.SkAr)))
   153  	m.ChildSa.Keys.SkArLen = buf.DecodeUint8()
   154  	m.ChildSa.Keys.SkEi = make([]byte, 64)
   155  	copy(m.ChildSa.Keys.SkEi, buf.DecodeBytes(len(m.ChildSa.Keys.SkEi)))
   156  	m.ChildSa.Keys.SkEiLen = buf.DecodeUint8()
   157  	m.ChildSa.Keys.SkEr = make([]byte, 64)
   158  	copy(m.ChildSa.Keys.SkEr, buf.DecodeBytes(len(m.ChildSa.Keys.SkEr)))
   159  	m.ChildSa.Keys.SkErLen = buf.DecodeUint8()
   160  	m.ChildSa.Keys.SkPi = make([]byte, 64)
   161  	copy(m.ChildSa.Keys.SkPi, buf.DecodeBytes(len(m.ChildSa.Keys.SkPi)))
   162  	m.ChildSa.Keys.SkPiLen = buf.DecodeUint8()
   163  	m.ChildSa.Keys.SkPr = make([]byte, 64)
   164  	copy(m.ChildSa.Keys.SkPr, buf.DecodeBytes(len(m.ChildSa.Keys.SkPr)))
   165  	m.ChildSa.Keys.SkPrLen = buf.DecodeUint8()
   166  	m.ChildSa.Encryption.TransformType = buf.DecodeUint8()
   167  	m.ChildSa.Encryption.TransformID = buf.DecodeUint16()
   168  	m.ChildSa.Encryption.KeyLen = buf.DecodeUint16()
   169  	m.ChildSa.Encryption.KeyTrunc = buf.DecodeUint16()
   170  	m.ChildSa.Encryption.BlockSize = buf.DecodeUint16()
   171  	m.ChildSa.Encryption.DhGroup = buf.DecodeUint8()
   172  	m.ChildSa.Integrity.TransformType = buf.DecodeUint8()
   173  	m.ChildSa.Integrity.TransformID = buf.DecodeUint16()
   174  	m.ChildSa.Integrity.KeyLen = buf.DecodeUint16()
   175  	m.ChildSa.Integrity.KeyTrunc = buf.DecodeUint16()
   176  	m.ChildSa.Integrity.BlockSize = buf.DecodeUint16()
   177  	m.ChildSa.Integrity.DhGroup = buf.DecodeUint8()
   178  	m.ChildSa.Esn.TransformType = buf.DecodeUint8()
   179  	m.ChildSa.Esn.TransformID = buf.DecodeUint16()
   180  	m.ChildSa.Esn.KeyLen = buf.DecodeUint16()
   181  	m.ChildSa.Esn.KeyTrunc = buf.DecodeUint16()
   182  	m.ChildSa.Esn.BlockSize = buf.DecodeUint16()
   183  	m.ChildSa.Esn.DhGroup = buf.DecodeUint8()
   184  	return nil
   185  }
   186  
   187  // Dump child SA of specific SA
   188  //   - sa_index - index of specific sa
   189  //
   190  // Ikev2ChildSaDump defines message 'ikev2_child_sa_dump'.
   191  // InProgress: the message form may change in the future versions
   192  type Ikev2ChildSaDump struct {
   193  	SaIndex uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"`
   194  }
   195  
   196  func (m *Ikev2ChildSaDump) Reset()               { *m = Ikev2ChildSaDump{} }
   197  func (*Ikev2ChildSaDump) GetMessageName() string { return "ikev2_child_sa_dump" }
   198  func (*Ikev2ChildSaDump) GetCrcString() string   { return "01eab609" }
   199  func (*Ikev2ChildSaDump) GetMessageType() api.MessageType {
   200  	return api.RequestMessage
   201  }
   202  
   203  func (m *Ikev2ChildSaDump) Size() (size int) {
   204  	if m == nil {
   205  		return 0
   206  	}
   207  	size += 4 // m.SaIndex
   208  	return size
   209  }
   210  func (m *Ikev2ChildSaDump) Marshal(b []byte) ([]byte, error) {
   211  	if b == nil {
   212  		b = make([]byte, m.Size())
   213  	}
   214  	buf := codec.NewBuffer(b)
   215  	buf.EncodeUint32(m.SaIndex)
   216  	return buf.Bytes(), nil
   217  }
   218  func (m *Ikev2ChildSaDump) Unmarshal(b []byte) error {
   219  	buf := codec.NewBuffer(b)
   220  	m.SaIndex = buf.DecodeUint32()
   221  	return nil
   222  }
   223  
   224  // IKEv2: Initiate the delete Child SA exchange
   225  //   - ispi - Child SA initiator SPI
   226  //
   227  // Ikev2InitiateDelChildSa defines message 'ikev2_initiate_del_child_sa'.
   228  // InProgress: the message form may change in the future versions
   229  type Ikev2InitiateDelChildSa struct {
   230  	Ispi uint32 `binapi:"u32,name=ispi" json:"ispi,omitempty"`
   231  }
   232  
   233  func (m *Ikev2InitiateDelChildSa) Reset()               { *m = Ikev2InitiateDelChildSa{} }
   234  func (*Ikev2InitiateDelChildSa) GetMessageName() string { return "ikev2_initiate_del_child_sa" }
   235  func (*Ikev2InitiateDelChildSa) GetCrcString() string   { return "7f004d2e" }
   236  func (*Ikev2InitiateDelChildSa) GetMessageType() api.MessageType {
   237  	return api.RequestMessage
   238  }
   239  
   240  func (m *Ikev2InitiateDelChildSa) Size() (size int) {
   241  	if m == nil {
   242  		return 0
   243  	}
   244  	size += 4 // m.Ispi
   245  	return size
   246  }
   247  func (m *Ikev2InitiateDelChildSa) Marshal(b []byte) ([]byte, error) {
   248  	if b == nil {
   249  		b = make([]byte, m.Size())
   250  	}
   251  	buf := codec.NewBuffer(b)
   252  	buf.EncodeUint32(m.Ispi)
   253  	return buf.Bytes(), nil
   254  }
   255  func (m *Ikev2InitiateDelChildSa) Unmarshal(b []byte) error {
   256  	buf := codec.NewBuffer(b)
   257  	m.Ispi = buf.DecodeUint32()
   258  	return nil
   259  }
   260  
   261  // Ikev2InitiateDelChildSaReply defines message 'ikev2_initiate_del_child_sa_reply'.
   262  // InProgress: the message form may change in the future versions
   263  type Ikev2InitiateDelChildSaReply struct {
   264  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   265  }
   266  
   267  func (m *Ikev2InitiateDelChildSaReply) Reset() { *m = Ikev2InitiateDelChildSaReply{} }
   268  func (*Ikev2InitiateDelChildSaReply) GetMessageName() string {
   269  	return "ikev2_initiate_del_child_sa_reply"
   270  }
   271  func (*Ikev2InitiateDelChildSaReply) GetCrcString() string { return "e8d4e804" }
   272  func (*Ikev2InitiateDelChildSaReply) GetMessageType() api.MessageType {
   273  	return api.ReplyMessage
   274  }
   275  
   276  func (m *Ikev2InitiateDelChildSaReply) Size() (size int) {
   277  	if m == nil {
   278  		return 0
   279  	}
   280  	size += 4 // m.Retval
   281  	return size
   282  }
   283  func (m *Ikev2InitiateDelChildSaReply) Marshal(b []byte) ([]byte, error) {
   284  	if b == nil {
   285  		b = make([]byte, m.Size())
   286  	}
   287  	buf := codec.NewBuffer(b)
   288  	buf.EncodeInt32(m.Retval)
   289  	return buf.Bytes(), nil
   290  }
   291  func (m *Ikev2InitiateDelChildSaReply) Unmarshal(b []byte) error {
   292  	buf := codec.NewBuffer(b)
   293  	m.Retval = buf.DecodeInt32()
   294  	return nil
   295  }
   296  
   297  // IKEv2: Initiate the delete IKE SA exchange
   298  //   - ispi - IKE SA initiator SPI
   299  //
   300  // Ikev2InitiateDelIkeSa defines message 'ikev2_initiate_del_ike_sa'.
   301  // InProgress: the message form may change in the future versions
   302  type Ikev2InitiateDelIkeSa struct {
   303  	Ispi uint64 `binapi:"u64,name=ispi" json:"ispi,omitempty"`
   304  }
   305  
   306  func (m *Ikev2InitiateDelIkeSa) Reset()               { *m = Ikev2InitiateDelIkeSa{} }
   307  func (*Ikev2InitiateDelIkeSa) GetMessageName() string { return "ikev2_initiate_del_ike_sa" }
   308  func (*Ikev2InitiateDelIkeSa) GetCrcString() string   { return "8d125bdd" }
   309  func (*Ikev2InitiateDelIkeSa) GetMessageType() api.MessageType {
   310  	return api.RequestMessage
   311  }
   312  
   313  func (m *Ikev2InitiateDelIkeSa) Size() (size int) {
   314  	if m == nil {
   315  		return 0
   316  	}
   317  	size += 8 // m.Ispi
   318  	return size
   319  }
   320  func (m *Ikev2InitiateDelIkeSa) Marshal(b []byte) ([]byte, error) {
   321  	if b == nil {
   322  		b = make([]byte, m.Size())
   323  	}
   324  	buf := codec.NewBuffer(b)
   325  	buf.EncodeUint64(m.Ispi)
   326  	return buf.Bytes(), nil
   327  }
   328  func (m *Ikev2InitiateDelIkeSa) Unmarshal(b []byte) error {
   329  	buf := codec.NewBuffer(b)
   330  	m.Ispi = buf.DecodeUint64()
   331  	return nil
   332  }
   333  
   334  // Ikev2InitiateDelIkeSaReply defines message 'ikev2_initiate_del_ike_sa_reply'.
   335  // InProgress: the message form may change in the future versions
   336  type Ikev2InitiateDelIkeSaReply struct {
   337  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   338  }
   339  
   340  func (m *Ikev2InitiateDelIkeSaReply) Reset()               { *m = Ikev2InitiateDelIkeSaReply{} }
   341  func (*Ikev2InitiateDelIkeSaReply) GetMessageName() string { return "ikev2_initiate_del_ike_sa_reply" }
   342  func (*Ikev2InitiateDelIkeSaReply) GetCrcString() string   { return "e8d4e804" }
   343  func (*Ikev2InitiateDelIkeSaReply) GetMessageType() api.MessageType {
   344  	return api.ReplyMessage
   345  }
   346  
   347  func (m *Ikev2InitiateDelIkeSaReply) Size() (size int) {
   348  	if m == nil {
   349  		return 0
   350  	}
   351  	size += 4 // m.Retval
   352  	return size
   353  }
   354  func (m *Ikev2InitiateDelIkeSaReply) Marshal(b []byte) ([]byte, error) {
   355  	if b == nil {
   356  		b = make([]byte, m.Size())
   357  	}
   358  	buf := codec.NewBuffer(b)
   359  	buf.EncodeInt32(m.Retval)
   360  	return buf.Bytes(), nil
   361  }
   362  func (m *Ikev2InitiateDelIkeSaReply) Unmarshal(b []byte) error {
   363  	buf := codec.NewBuffer(b)
   364  	m.Retval = buf.DecodeInt32()
   365  	return nil
   366  }
   367  
   368  // IKEv2: Initiate the rekey Child SA exchange
   369  //   - ispi - Child SA initiator SPI
   370  //
   371  // Ikev2InitiateRekeyChildSa defines message 'ikev2_initiate_rekey_child_sa'.
   372  // InProgress: the message form may change in the future versions
   373  type Ikev2InitiateRekeyChildSa struct {
   374  	Ispi uint32 `binapi:"u32,name=ispi" json:"ispi,omitempty"`
   375  }
   376  
   377  func (m *Ikev2InitiateRekeyChildSa) Reset()               { *m = Ikev2InitiateRekeyChildSa{} }
   378  func (*Ikev2InitiateRekeyChildSa) GetMessageName() string { return "ikev2_initiate_rekey_child_sa" }
   379  func (*Ikev2InitiateRekeyChildSa) GetCrcString() string   { return "7f004d2e" }
   380  func (*Ikev2InitiateRekeyChildSa) GetMessageType() api.MessageType {
   381  	return api.RequestMessage
   382  }
   383  
   384  func (m *Ikev2InitiateRekeyChildSa) Size() (size int) {
   385  	if m == nil {
   386  		return 0
   387  	}
   388  	size += 4 // m.Ispi
   389  	return size
   390  }
   391  func (m *Ikev2InitiateRekeyChildSa) Marshal(b []byte) ([]byte, error) {
   392  	if b == nil {
   393  		b = make([]byte, m.Size())
   394  	}
   395  	buf := codec.NewBuffer(b)
   396  	buf.EncodeUint32(m.Ispi)
   397  	return buf.Bytes(), nil
   398  }
   399  func (m *Ikev2InitiateRekeyChildSa) Unmarshal(b []byte) error {
   400  	buf := codec.NewBuffer(b)
   401  	m.Ispi = buf.DecodeUint32()
   402  	return nil
   403  }
   404  
   405  // Ikev2InitiateRekeyChildSaReply defines message 'ikev2_initiate_rekey_child_sa_reply'.
   406  // InProgress: the message form may change in the future versions
   407  type Ikev2InitiateRekeyChildSaReply struct {
   408  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   409  }
   410  
   411  func (m *Ikev2InitiateRekeyChildSaReply) Reset() { *m = Ikev2InitiateRekeyChildSaReply{} }
   412  func (*Ikev2InitiateRekeyChildSaReply) GetMessageName() string {
   413  	return "ikev2_initiate_rekey_child_sa_reply"
   414  }
   415  func (*Ikev2InitiateRekeyChildSaReply) GetCrcString() string { return "e8d4e804" }
   416  func (*Ikev2InitiateRekeyChildSaReply) GetMessageType() api.MessageType {
   417  	return api.ReplyMessage
   418  }
   419  
   420  func (m *Ikev2InitiateRekeyChildSaReply) Size() (size int) {
   421  	if m == nil {
   422  		return 0
   423  	}
   424  	size += 4 // m.Retval
   425  	return size
   426  }
   427  func (m *Ikev2InitiateRekeyChildSaReply) Marshal(b []byte) ([]byte, error) {
   428  	if b == nil {
   429  		b = make([]byte, m.Size())
   430  	}
   431  	buf := codec.NewBuffer(b)
   432  	buf.EncodeInt32(m.Retval)
   433  	return buf.Bytes(), nil
   434  }
   435  func (m *Ikev2InitiateRekeyChildSaReply) Unmarshal(b []byte) error {
   436  	buf := codec.NewBuffer(b)
   437  	m.Retval = buf.DecodeInt32()
   438  	return nil
   439  }
   440  
   441  // IKEv2: Initiate the SA_INIT exchange
   442  //   - name - IKEv2 profile name
   443  //
   444  // Ikev2InitiateSaInit defines message 'ikev2_initiate_sa_init'.
   445  // InProgress: the message form may change in the future versions
   446  type Ikev2InitiateSaInit struct {
   447  	Name string `binapi:"string[64],name=name" json:"name,omitempty"`
   448  }
   449  
   450  func (m *Ikev2InitiateSaInit) Reset()               { *m = Ikev2InitiateSaInit{} }
   451  func (*Ikev2InitiateSaInit) GetMessageName() string { return "ikev2_initiate_sa_init" }
   452  func (*Ikev2InitiateSaInit) GetCrcString() string   { return "ebf79a66" }
   453  func (*Ikev2InitiateSaInit) GetMessageType() api.MessageType {
   454  	return api.RequestMessage
   455  }
   456  
   457  func (m *Ikev2InitiateSaInit) Size() (size int) {
   458  	if m == nil {
   459  		return 0
   460  	}
   461  	size += 64 // m.Name
   462  	return size
   463  }
   464  func (m *Ikev2InitiateSaInit) Marshal(b []byte) ([]byte, error) {
   465  	if b == nil {
   466  		b = make([]byte, m.Size())
   467  	}
   468  	buf := codec.NewBuffer(b)
   469  	buf.EncodeString(m.Name, 64)
   470  	return buf.Bytes(), nil
   471  }
   472  func (m *Ikev2InitiateSaInit) Unmarshal(b []byte) error {
   473  	buf := codec.NewBuffer(b)
   474  	m.Name = buf.DecodeString(64)
   475  	return nil
   476  }
   477  
   478  // Ikev2InitiateSaInitReply defines message 'ikev2_initiate_sa_init_reply'.
   479  // InProgress: the message form may change in the future versions
   480  type Ikev2InitiateSaInitReply struct {
   481  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   482  }
   483  
   484  func (m *Ikev2InitiateSaInitReply) Reset()               { *m = Ikev2InitiateSaInitReply{} }
   485  func (*Ikev2InitiateSaInitReply) GetMessageName() string { return "ikev2_initiate_sa_init_reply" }
   486  func (*Ikev2InitiateSaInitReply) GetCrcString() string   { return "e8d4e804" }
   487  func (*Ikev2InitiateSaInitReply) GetMessageType() api.MessageType {
   488  	return api.ReplyMessage
   489  }
   490  
   491  func (m *Ikev2InitiateSaInitReply) Size() (size int) {
   492  	if m == nil {
   493  		return 0
   494  	}
   495  	size += 4 // m.Retval
   496  	return size
   497  }
   498  func (m *Ikev2InitiateSaInitReply) Marshal(b []byte) ([]byte, error) {
   499  	if b == nil {
   500  		b = make([]byte, m.Size())
   501  	}
   502  	buf := codec.NewBuffer(b)
   503  	buf.EncodeInt32(m.Retval)
   504  	return buf.Bytes(), nil
   505  }
   506  func (m *Ikev2InitiateSaInitReply) Unmarshal(b []byte) error {
   507  	buf := codec.NewBuffer(b)
   508  	m.Retval = buf.DecodeInt32()
   509  	return nil
   510  }
   511  
   512  // get specific nonce
   513  //   - is_initiator - specify type initiator|responder of nonce
   514  //   - sa_index - index of specific sa
   515  //
   516  // Ikev2NonceGet defines message 'ikev2_nonce_get'.
   517  // InProgress: the message form may change in the future versions
   518  type Ikev2NonceGet struct {
   519  	IsInitiator bool   `binapi:"bool,name=is_initiator" json:"is_initiator,omitempty"`
   520  	SaIndex     uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"`
   521  }
   522  
   523  func (m *Ikev2NonceGet) Reset()               { *m = Ikev2NonceGet{} }
   524  func (*Ikev2NonceGet) GetMessageName() string { return "ikev2_nonce_get" }
   525  func (*Ikev2NonceGet) GetCrcString() string   { return "7fe9ad51" }
   526  func (*Ikev2NonceGet) GetMessageType() api.MessageType {
   527  	return api.RequestMessage
   528  }
   529  
   530  func (m *Ikev2NonceGet) Size() (size int) {
   531  	if m == nil {
   532  		return 0
   533  	}
   534  	size += 1 // m.IsInitiator
   535  	size += 4 // m.SaIndex
   536  	return size
   537  }
   538  func (m *Ikev2NonceGet) Marshal(b []byte) ([]byte, error) {
   539  	if b == nil {
   540  		b = make([]byte, m.Size())
   541  	}
   542  	buf := codec.NewBuffer(b)
   543  	buf.EncodeBool(m.IsInitiator)
   544  	buf.EncodeUint32(m.SaIndex)
   545  	return buf.Bytes(), nil
   546  }
   547  func (m *Ikev2NonceGet) Unmarshal(b []byte) error {
   548  	buf := codec.NewBuffer(b)
   549  	m.IsInitiator = buf.DecodeBool()
   550  	m.SaIndex = buf.DecodeUint32()
   551  	return nil
   552  }
   553  
   554  // reply on specific nonce
   555  //   - retval - return code
   556  //   - data_len - nonce length
   557  //   - nonce - nonce data
   558  //
   559  // Ikev2NonceGetReply defines message 'ikev2_nonce_get_reply'.
   560  // InProgress: the message form may change in the future versions
   561  type Ikev2NonceGetReply struct {
   562  	Retval  int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
   563  	DataLen uint32 `binapi:"u32,name=data_len" json:"-"`
   564  	Nonce   []byte `binapi:"u8[data_len],name=nonce" json:"nonce,omitempty"`
   565  }
   566  
   567  func (m *Ikev2NonceGetReply) Reset()               { *m = Ikev2NonceGetReply{} }
   568  func (*Ikev2NonceGetReply) GetMessageName() string { return "ikev2_nonce_get_reply" }
   569  func (*Ikev2NonceGetReply) GetCrcString() string   { return "1b37a342" }
   570  func (*Ikev2NonceGetReply) GetMessageType() api.MessageType {
   571  	return api.ReplyMessage
   572  }
   573  
   574  func (m *Ikev2NonceGetReply) Size() (size int) {
   575  	if m == nil {
   576  		return 0
   577  	}
   578  	size += 4                // m.Retval
   579  	size += 4                // m.DataLen
   580  	size += 1 * len(m.Nonce) // m.Nonce
   581  	return size
   582  }
   583  func (m *Ikev2NonceGetReply) Marshal(b []byte) ([]byte, error) {
   584  	if b == nil {
   585  		b = make([]byte, m.Size())
   586  	}
   587  	buf := codec.NewBuffer(b)
   588  	buf.EncodeInt32(m.Retval)
   589  	buf.EncodeUint32(uint32(len(m.Nonce)))
   590  	buf.EncodeBytes(m.Nonce, 0)
   591  	return buf.Bytes(), nil
   592  }
   593  func (m *Ikev2NonceGetReply) Unmarshal(b []byte) error {
   594  	buf := codec.NewBuffer(b)
   595  	m.Retval = buf.DecodeInt32()
   596  	m.DataLen = buf.DecodeUint32()
   597  	m.Nonce = make([]byte, m.DataLen)
   598  	copy(m.Nonce, buf.DecodeBytes(len(m.Nonce)))
   599  	return nil
   600  }
   601  
   602  // Get the plugin version
   603  // Ikev2PluginGetVersion defines message 'ikev2_plugin_get_version'.
   604  type Ikev2PluginGetVersion struct{}
   605  
   606  func (m *Ikev2PluginGetVersion) Reset()               { *m = Ikev2PluginGetVersion{} }
   607  func (*Ikev2PluginGetVersion) GetMessageName() string { return "ikev2_plugin_get_version" }
   608  func (*Ikev2PluginGetVersion) GetCrcString() string   { return "51077d14" }
   609  func (*Ikev2PluginGetVersion) GetMessageType() api.MessageType {
   610  	return api.RequestMessage
   611  }
   612  
   613  func (m *Ikev2PluginGetVersion) Size() (size int) {
   614  	if m == nil {
   615  		return 0
   616  	}
   617  	return size
   618  }
   619  func (m *Ikev2PluginGetVersion) Marshal(b []byte) ([]byte, error) {
   620  	if b == nil {
   621  		b = make([]byte, m.Size())
   622  	}
   623  	buf := codec.NewBuffer(b)
   624  	return buf.Bytes(), nil
   625  }
   626  func (m *Ikev2PluginGetVersion) Unmarshal(b []byte) error {
   627  	return nil
   628  }
   629  
   630  // Reply to get the plugin version
   631  //   - major - Incremented every time a known breaking behavior change is introduced
   632  //   - minor - Incremented with small changes, may be used to avoid buggy versions
   633  //
   634  // Ikev2PluginGetVersionReply defines message 'ikev2_plugin_get_version_reply'.
   635  type Ikev2PluginGetVersionReply struct {
   636  	Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
   637  	Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
   638  }
   639  
   640  func (m *Ikev2PluginGetVersionReply) Reset()               { *m = Ikev2PluginGetVersionReply{} }
   641  func (*Ikev2PluginGetVersionReply) GetMessageName() string { return "ikev2_plugin_get_version_reply" }
   642  func (*Ikev2PluginGetVersionReply) GetCrcString() string   { return "9b32cf86" }
   643  func (*Ikev2PluginGetVersionReply) GetMessageType() api.MessageType {
   644  	return api.ReplyMessage
   645  }
   646  
   647  func (m *Ikev2PluginGetVersionReply) Size() (size int) {
   648  	if m == nil {
   649  		return 0
   650  	}
   651  	size += 4 // m.Major
   652  	size += 4 // m.Minor
   653  	return size
   654  }
   655  func (m *Ikev2PluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
   656  	if b == nil {
   657  		b = make([]byte, m.Size())
   658  	}
   659  	buf := codec.NewBuffer(b)
   660  	buf.EncodeUint32(m.Major)
   661  	buf.EncodeUint32(m.Minor)
   662  	return buf.Bytes(), nil
   663  }
   664  func (m *Ikev2PluginGetVersionReply) Unmarshal(b []byte) error {
   665  	buf := codec.NewBuffer(b)
   666  	m.Major = buf.DecodeUint32()
   667  	m.Minor = buf.DecodeUint32()
   668  	return nil
   669  }
   670  
   671  // IKEv2: Add/delete profile
   672  //   - name - IKEv2 profile name
   673  //   - is_add - Add IKEv2 profile if non-zero, else delete
   674  //
   675  // Ikev2ProfileAddDel defines message 'ikev2_profile_add_del'.
   676  // InProgress: the message form may change in the future versions
   677  type Ikev2ProfileAddDel struct {
   678  	Name  string `binapi:"string[64],name=name" json:"name,omitempty"`
   679  	IsAdd bool   `binapi:"bool,name=is_add" json:"is_add,omitempty"`
   680  }
   681  
   682  func (m *Ikev2ProfileAddDel) Reset()               { *m = Ikev2ProfileAddDel{} }
   683  func (*Ikev2ProfileAddDel) GetMessageName() string { return "ikev2_profile_add_del" }
   684  func (*Ikev2ProfileAddDel) GetCrcString() string   { return "2c925b55" }
   685  func (*Ikev2ProfileAddDel) GetMessageType() api.MessageType {
   686  	return api.RequestMessage
   687  }
   688  
   689  func (m *Ikev2ProfileAddDel) Size() (size int) {
   690  	if m == nil {
   691  		return 0
   692  	}
   693  	size += 64 // m.Name
   694  	size += 1  // m.IsAdd
   695  	return size
   696  }
   697  func (m *Ikev2ProfileAddDel) Marshal(b []byte) ([]byte, error) {
   698  	if b == nil {
   699  		b = make([]byte, m.Size())
   700  	}
   701  	buf := codec.NewBuffer(b)
   702  	buf.EncodeString(m.Name, 64)
   703  	buf.EncodeBool(m.IsAdd)
   704  	return buf.Bytes(), nil
   705  }
   706  func (m *Ikev2ProfileAddDel) Unmarshal(b []byte) error {
   707  	buf := codec.NewBuffer(b)
   708  	m.Name = buf.DecodeString(64)
   709  	m.IsAdd = buf.DecodeBool()
   710  	return nil
   711  }
   712  
   713  // Ikev2ProfileAddDelReply defines message 'ikev2_profile_add_del_reply'.
   714  // InProgress: the message form may change in the future versions
   715  type Ikev2ProfileAddDelReply struct {
   716  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   717  }
   718  
   719  func (m *Ikev2ProfileAddDelReply) Reset()               { *m = Ikev2ProfileAddDelReply{} }
   720  func (*Ikev2ProfileAddDelReply) GetMessageName() string { return "ikev2_profile_add_del_reply" }
   721  func (*Ikev2ProfileAddDelReply) GetCrcString() string   { return "e8d4e804" }
   722  func (*Ikev2ProfileAddDelReply) GetMessageType() api.MessageType {
   723  	return api.ReplyMessage
   724  }
   725  
   726  func (m *Ikev2ProfileAddDelReply) Size() (size int) {
   727  	if m == nil {
   728  		return 0
   729  	}
   730  	size += 4 // m.Retval
   731  	return size
   732  }
   733  func (m *Ikev2ProfileAddDelReply) Marshal(b []byte) ([]byte, error) {
   734  	if b == nil {
   735  		b = make([]byte, m.Size())
   736  	}
   737  	buf := codec.NewBuffer(b)
   738  	buf.EncodeInt32(m.Retval)
   739  	return buf.Bytes(), nil
   740  }
   741  func (m *Ikev2ProfileAddDelReply) Unmarshal(b []byte) error {
   742  	buf := codec.NewBuffer(b)
   743  	m.Retval = buf.DecodeInt32()
   744  	return nil
   745  }
   746  
   747  // Details about all profiles
   748  //   - profile - profile element with encapsulated attributes
   749  //
   750  // Ikev2ProfileDetails defines message 'ikev2_profile_details'.
   751  // InProgress: the message form may change in the future versions
   752  type Ikev2ProfileDetails struct {
   753  	Profile ikev2_types.Ikev2Profile `binapi:"ikev2_profile,name=profile" json:"profile,omitempty"`
   754  }
   755  
   756  func (m *Ikev2ProfileDetails) Reset()               { *m = Ikev2ProfileDetails{} }
   757  func (*Ikev2ProfileDetails) GetMessageName() string { return "ikev2_profile_details" }
   758  func (*Ikev2ProfileDetails) GetCrcString() string   { return "670d01d9" }
   759  func (*Ikev2ProfileDetails) GetMessageType() api.MessageType {
   760  	return api.ReplyMessage
   761  }
   762  
   763  func (m *Ikev2ProfileDetails) Size() (size int) {
   764  	if m == nil {
   765  		return 0
   766  	}
   767  	size += 64                           // m.Profile.Name
   768  	size += 1                            // m.Profile.LocID.Type
   769  	size += 1                            // m.Profile.LocID.DataLen
   770  	size += 64                           // m.Profile.LocID.Data
   771  	size += 1                            // m.Profile.RemID.Type
   772  	size += 1                            // m.Profile.RemID.DataLen
   773  	size += 64                           // m.Profile.RemID.Data
   774  	size += 4                            // m.Profile.LocTs.SaIndex
   775  	size += 4                            // m.Profile.LocTs.ChildSaIndex
   776  	size += 1                            // m.Profile.LocTs.IsLocal
   777  	size += 1                            // m.Profile.LocTs.ProtocolID
   778  	size += 2                            // m.Profile.LocTs.StartPort
   779  	size += 2                            // m.Profile.LocTs.EndPort
   780  	size += 1                            // m.Profile.LocTs.StartAddr.Af
   781  	size += 1 * 16                       // m.Profile.LocTs.StartAddr.Un
   782  	size += 1                            // m.Profile.LocTs.EndAddr.Af
   783  	size += 1 * 16                       // m.Profile.LocTs.EndAddr.Un
   784  	size += 4                            // m.Profile.RemTs.SaIndex
   785  	size += 4                            // m.Profile.RemTs.ChildSaIndex
   786  	size += 1                            // m.Profile.RemTs.IsLocal
   787  	size += 1                            // m.Profile.RemTs.ProtocolID
   788  	size += 2                            // m.Profile.RemTs.StartPort
   789  	size += 2                            // m.Profile.RemTs.EndPort
   790  	size += 1                            // m.Profile.RemTs.StartAddr.Af
   791  	size += 1 * 16                       // m.Profile.RemTs.StartAddr.Un
   792  	size += 1                            // m.Profile.RemTs.EndAddr.Af
   793  	size += 1 * 16                       // m.Profile.RemTs.EndAddr.Un
   794  	size += 4                            // m.Profile.Responder.SwIfIndex
   795  	size += 1                            // m.Profile.Responder.Addr.Af
   796  	size += 1 * 16                       // m.Profile.Responder.Addr.Un
   797  	size += 1                            // m.Profile.IkeTs.CryptoAlg
   798  	size += 4                            // m.Profile.IkeTs.CryptoKeySize
   799  	size += 1                            // m.Profile.IkeTs.IntegAlg
   800  	size += 1                            // m.Profile.IkeTs.DhGroup
   801  	size += 1                            // m.Profile.EspTs.CryptoAlg
   802  	size += 4                            // m.Profile.EspTs.CryptoKeySize
   803  	size += 1                            // m.Profile.EspTs.IntegAlg
   804  	size += 8                            // m.Profile.Lifetime
   805  	size += 8                            // m.Profile.LifetimeMaxdata
   806  	size += 4                            // m.Profile.LifetimeJitter
   807  	size += 4                            // m.Profile.Handover
   808  	size += 2                            // m.Profile.IpsecOverUDPPort
   809  	size += 4                            // m.Profile.TunItf
   810  	size += 1                            // m.Profile.UDPEncap
   811  	size += 1                            // m.Profile.NattDisabled
   812  	size += 1                            // m.Profile.Auth.Method
   813  	size += 1                            // m.Profile.Auth.Hex
   814  	size += 4                            // m.Profile.Auth.DataLen
   815  	size += 1 * len(m.Profile.Auth.Data) // m.Profile.Auth.Data
   816  	return size
   817  }
   818  func (m *Ikev2ProfileDetails) Marshal(b []byte) ([]byte, error) {
   819  	if b == nil {
   820  		b = make([]byte, m.Size())
   821  	}
   822  	buf := codec.NewBuffer(b)
   823  	buf.EncodeString(m.Profile.Name, 64)
   824  	buf.EncodeUint8(m.Profile.LocID.Type)
   825  	buf.EncodeUint8(m.Profile.LocID.DataLen)
   826  	buf.EncodeString(m.Profile.LocID.Data, 64)
   827  	buf.EncodeUint8(m.Profile.RemID.Type)
   828  	buf.EncodeUint8(m.Profile.RemID.DataLen)
   829  	buf.EncodeString(m.Profile.RemID.Data, 64)
   830  	buf.EncodeUint32(m.Profile.LocTs.SaIndex)
   831  	buf.EncodeUint32(m.Profile.LocTs.ChildSaIndex)
   832  	buf.EncodeBool(m.Profile.LocTs.IsLocal)
   833  	buf.EncodeUint8(m.Profile.LocTs.ProtocolID)
   834  	buf.EncodeUint16(m.Profile.LocTs.StartPort)
   835  	buf.EncodeUint16(m.Profile.LocTs.EndPort)
   836  	buf.EncodeUint8(uint8(m.Profile.LocTs.StartAddr.Af))
   837  	buf.EncodeBytes(m.Profile.LocTs.StartAddr.Un.XXX_UnionData[:], 16)
   838  	buf.EncodeUint8(uint8(m.Profile.LocTs.EndAddr.Af))
   839  	buf.EncodeBytes(m.Profile.LocTs.EndAddr.Un.XXX_UnionData[:], 16)
   840  	buf.EncodeUint32(m.Profile.RemTs.SaIndex)
   841  	buf.EncodeUint32(m.Profile.RemTs.ChildSaIndex)
   842  	buf.EncodeBool(m.Profile.RemTs.IsLocal)
   843  	buf.EncodeUint8(m.Profile.RemTs.ProtocolID)
   844  	buf.EncodeUint16(m.Profile.RemTs.StartPort)
   845  	buf.EncodeUint16(m.Profile.RemTs.EndPort)
   846  	buf.EncodeUint8(uint8(m.Profile.RemTs.StartAddr.Af))
   847  	buf.EncodeBytes(m.Profile.RemTs.StartAddr.Un.XXX_UnionData[:], 16)
   848  	buf.EncodeUint8(uint8(m.Profile.RemTs.EndAddr.Af))
   849  	buf.EncodeBytes(m.Profile.RemTs.EndAddr.Un.XXX_UnionData[:], 16)
   850  	buf.EncodeUint32(uint32(m.Profile.Responder.SwIfIndex))
   851  	buf.EncodeUint8(uint8(m.Profile.Responder.Addr.Af))
   852  	buf.EncodeBytes(m.Profile.Responder.Addr.Un.XXX_UnionData[:], 16)
   853  	buf.EncodeUint8(m.Profile.IkeTs.CryptoAlg)
   854  	buf.EncodeUint32(m.Profile.IkeTs.CryptoKeySize)
   855  	buf.EncodeUint8(m.Profile.IkeTs.IntegAlg)
   856  	buf.EncodeUint8(m.Profile.IkeTs.DhGroup)
   857  	buf.EncodeUint8(m.Profile.EspTs.CryptoAlg)
   858  	buf.EncodeUint32(m.Profile.EspTs.CryptoKeySize)
   859  	buf.EncodeUint8(m.Profile.EspTs.IntegAlg)
   860  	buf.EncodeUint64(m.Profile.Lifetime)
   861  	buf.EncodeUint64(m.Profile.LifetimeMaxdata)
   862  	buf.EncodeUint32(m.Profile.LifetimeJitter)
   863  	buf.EncodeUint32(m.Profile.Handover)
   864  	buf.EncodeUint16(m.Profile.IpsecOverUDPPort)
   865  	buf.EncodeUint32(m.Profile.TunItf)
   866  	buf.EncodeBool(m.Profile.UDPEncap)
   867  	buf.EncodeBool(m.Profile.NattDisabled)
   868  	buf.EncodeUint8(m.Profile.Auth.Method)
   869  	buf.EncodeUint8(m.Profile.Auth.Hex)
   870  	buf.EncodeUint32(uint32(len(m.Profile.Auth.Data)))
   871  	buf.EncodeBytes(m.Profile.Auth.Data, 0)
   872  	return buf.Bytes(), nil
   873  }
   874  func (m *Ikev2ProfileDetails) Unmarshal(b []byte) error {
   875  	buf := codec.NewBuffer(b)
   876  	m.Profile.Name = buf.DecodeString(64)
   877  	m.Profile.LocID.Type = buf.DecodeUint8()
   878  	m.Profile.LocID.DataLen = buf.DecodeUint8()
   879  	m.Profile.LocID.Data = buf.DecodeString(64)
   880  	m.Profile.RemID.Type = buf.DecodeUint8()
   881  	m.Profile.RemID.DataLen = buf.DecodeUint8()
   882  	m.Profile.RemID.Data = buf.DecodeString(64)
   883  	m.Profile.LocTs.SaIndex = buf.DecodeUint32()
   884  	m.Profile.LocTs.ChildSaIndex = buf.DecodeUint32()
   885  	m.Profile.LocTs.IsLocal = buf.DecodeBool()
   886  	m.Profile.LocTs.ProtocolID = buf.DecodeUint8()
   887  	m.Profile.LocTs.StartPort = buf.DecodeUint16()
   888  	m.Profile.LocTs.EndPort = buf.DecodeUint16()
   889  	m.Profile.LocTs.StartAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
   890  	copy(m.Profile.LocTs.StartAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   891  	m.Profile.LocTs.EndAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
   892  	copy(m.Profile.LocTs.EndAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   893  	m.Profile.RemTs.SaIndex = buf.DecodeUint32()
   894  	m.Profile.RemTs.ChildSaIndex = buf.DecodeUint32()
   895  	m.Profile.RemTs.IsLocal = buf.DecodeBool()
   896  	m.Profile.RemTs.ProtocolID = buf.DecodeUint8()
   897  	m.Profile.RemTs.StartPort = buf.DecodeUint16()
   898  	m.Profile.RemTs.EndPort = buf.DecodeUint16()
   899  	m.Profile.RemTs.StartAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
   900  	copy(m.Profile.RemTs.StartAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   901  	m.Profile.RemTs.EndAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
   902  	copy(m.Profile.RemTs.EndAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   903  	m.Profile.Responder.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   904  	m.Profile.Responder.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
   905  	copy(m.Profile.Responder.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   906  	m.Profile.IkeTs.CryptoAlg = buf.DecodeUint8()
   907  	m.Profile.IkeTs.CryptoKeySize = buf.DecodeUint32()
   908  	m.Profile.IkeTs.IntegAlg = buf.DecodeUint8()
   909  	m.Profile.IkeTs.DhGroup = buf.DecodeUint8()
   910  	m.Profile.EspTs.CryptoAlg = buf.DecodeUint8()
   911  	m.Profile.EspTs.CryptoKeySize = buf.DecodeUint32()
   912  	m.Profile.EspTs.IntegAlg = buf.DecodeUint8()
   913  	m.Profile.Lifetime = buf.DecodeUint64()
   914  	m.Profile.LifetimeMaxdata = buf.DecodeUint64()
   915  	m.Profile.LifetimeJitter = buf.DecodeUint32()
   916  	m.Profile.Handover = buf.DecodeUint32()
   917  	m.Profile.IpsecOverUDPPort = buf.DecodeUint16()
   918  	m.Profile.TunItf = buf.DecodeUint32()
   919  	m.Profile.UDPEncap = buf.DecodeBool()
   920  	m.Profile.NattDisabled = buf.DecodeBool()
   921  	m.Profile.Auth.Method = buf.DecodeUint8()
   922  	m.Profile.Auth.Hex = buf.DecodeUint8()
   923  	m.Profile.Auth.DataLen = buf.DecodeUint32()
   924  	m.Profile.Auth.Data = make([]byte, m.Profile.Auth.DataLen)
   925  	copy(m.Profile.Auth.Data, buf.DecodeBytes(len(m.Profile.Auth.Data)))
   926  	return nil
   927  }
   928  
   929  // IKEv2: Disable NAT traversal
   930  //   - name - IKEv2 profile name
   931  //
   932  // Ikev2ProfileDisableNatt defines message 'ikev2_profile_disable_natt'.
   933  // InProgress: the message form may change in the future versions
   934  type Ikev2ProfileDisableNatt struct {
   935  	Name string `binapi:"string[64],name=name" json:"name,omitempty"`
   936  }
   937  
   938  func (m *Ikev2ProfileDisableNatt) Reset()               { *m = Ikev2ProfileDisableNatt{} }
   939  func (*Ikev2ProfileDisableNatt) GetMessageName() string { return "ikev2_profile_disable_natt" }
   940  func (*Ikev2ProfileDisableNatt) GetCrcString() string   { return "ebf79a66" }
   941  func (*Ikev2ProfileDisableNatt) GetMessageType() api.MessageType {
   942  	return api.RequestMessage
   943  }
   944  
   945  func (m *Ikev2ProfileDisableNatt) Size() (size int) {
   946  	if m == nil {
   947  		return 0
   948  	}
   949  	size += 64 // m.Name
   950  	return size
   951  }
   952  func (m *Ikev2ProfileDisableNatt) Marshal(b []byte) ([]byte, error) {
   953  	if b == nil {
   954  		b = make([]byte, m.Size())
   955  	}
   956  	buf := codec.NewBuffer(b)
   957  	buf.EncodeString(m.Name, 64)
   958  	return buf.Bytes(), nil
   959  }
   960  func (m *Ikev2ProfileDisableNatt) Unmarshal(b []byte) error {
   961  	buf := codec.NewBuffer(b)
   962  	m.Name = buf.DecodeString(64)
   963  	return nil
   964  }
   965  
   966  // Ikev2ProfileDisableNattReply defines message 'ikev2_profile_disable_natt_reply'.
   967  // InProgress: the message form may change in the future versions
   968  type Ikev2ProfileDisableNattReply struct {
   969  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   970  }
   971  
   972  func (m *Ikev2ProfileDisableNattReply) Reset() { *m = Ikev2ProfileDisableNattReply{} }
   973  func (*Ikev2ProfileDisableNattReply) GetMessageName() string {
   974  	return "ikev2_profile_disable_natt_reply"
   975  }
   976  func (*Ikev2ProfileDisableNattReply) GetCrcString() string { return "e8d4e804" }
   977  func (*Ikev2ProfileDisableNattReply) GetMessageType() api.MessageType {
   978  	return api.ReplyMessage
   979  }
   980  
   981  func (m *Ikev2ProfileDisableNattReply) Size() (size int) {
   982  	if m == nil {
   983  		return 0
   984  	}
   985  	size += 4 // m.Retval
   986  	return size
   987  }
   988  func (m *Ikev2ProfileDisableNattReply) Marshal(b []byte) ([]byte, error) {
   989  	if b == nil {
   990  		b = make([]byte, m.Size())
   991  	}
   992  	buf := codec.NewBuffer(b)
   993  	buf.EncodeInt32(m.Retval)
   994  	return buf.Bytes(), nil
   995  }
   996  func (m *Ikev2ProfileDisableNattReply) Unmarshal(b []byte) error {
   997  	buf := codec.NewBuffer(b)
   998  	m.Retval = buf.DecodeInt32()
   999  	return nil
  1000  }
  1001  
  1002  // Dump all profiles
  1003  // Ikev2ProfileDump defines message 'ikev2_profile_dump'.
  1004  // InProgress: the message form may change in the future versions
  1005  type Ikev2ProfileDump struct{}
  1006  
  1007  func (m *Ikev2ProfileDump) Reset()               { *m = Ikev2ProfileDump{} }
  1008  func (*Ikev2ProfileDump) GetMessageName() string { return "ikev2_profile_dump" }
  1009  func (*Ikev2ProfileDump) GetCrcString() string   { return "51077d14" }
  1010  func (*Ikev2ProfileDump) GetMessageType() api.MessageType {
  1011  	return api.RequestMessage
  1012  }
  1013  
  1014  func (m *Ikev2ProfileDump) Size() (size int) {
  1015  	if m == nil {
  1016  		return 0
  1017  	}
  1018  	return size
  1019  }
  1020  func (m *Ikev2ProfileDump) Marshal(b []byte) ([]byte, error) {
  1021  	if b == nil {
  1022  		b = make([]byte, m.Size())
  1023  	}
  1024  	buf := codec.NewBuffer(b)
  1025  	return buf.Bytes(), nil
  1026  }
  1027  func (m *Ikev2ProfileDump) Unmarshal(b []byte) error {
  1028  	return nil
  1029  }
  1030  
  1031  // IKEv2: Set IKEv2 profile authentication method
  1032  //   - name - IKEv2 profile name
  1033  //   - auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
  1034  //   - is_hex - Authentication data in hex format if non-zero, else string
  1035  //   - data_len - Authentication data length
  1036  //   - data - Authentication data (for rsa-sig cert file path)
  1037  //
  1038  // Ikev2ProfileSetAuth defines message 'ikev2_profile_set_auth'.
  1039  // InProgress: the message form may change in the future versions
  1040  type Ikev2ProfileSetAuth struct {
  1041  	Name       string `binapi:"string[64],name=name" json:"name,omitempty"`
  1042  	AuthMethod uint8  `binapi:"u8,name=auth_method" json:"auth_method,omitempty"`
  1043  	IsHex      bool   `binapi:"bool,name=is_hex" json:"is_hex,omitempty"`
  1044  	DataLen    uint32 `binapi:"u32,name=data_len" json:"-"`
  1045  	Data       []byte `binapi:"u8[data_len],name=data" json:"data,omitempty"`
  1046  }
  1047  
  1048  func (m *Ikev2ProfileSetAuth) Reset()               { *m = Ikev2ProfileSetAuth{} }
  1049  func (*Ikev2ProfileSetAuth) GetMessageName() string { return "ikev2_profile_set_auth" }
  1050  func (*Ikev2ProfileSetAuth) GetCrcString() string   { return "642c97cd" }
  1051  func (*Ikev2ProfileSetAuth) GetMessageType() api.MessageType {
  1052  	return api.RequestMessage
  1053  }
  1054  
  1055  func (m *Ikev2ProfileSetAuth) Size() (size int) {
  1056  	if m == nil {
  1057  		return 0
  1058  	}
  1059  	size += 64              // m.Name
  1060  	size += 1               // m.AuthMethod
  1061  	size += 1               // m.IsHex
  1062  	size += 4               // m.DataLen
  1063  	size += 1 * len(m.Data) // m.Data
  1064  	return size
  1065  }
  1066  func (m *Ikev2ProfileSetAuth) Marshal(b []byte) ([]byte, error) {
  1067  	if b == nil {
  1068  		b = make([]byte, m.Size())
  1069  	}
  1070  	buf := codec.NewBuffer(b)
  1071  	buf.EncodeString(m.Name, 64)
  1072  	buf.EncodeUint8(m.AuthMethod)
  1073  	buf.EncodeBool(m.IsHex)
  1074  	buf.EncodeUint32(uint32(len(m.Data)))
  1075  	buf.EncodeBytes(m.Data, 0)
  1076  	return buf.Bytes(), nil
  1077  }
  1078  func (m *Ikev2ProfileSetAuth) Unmarshal(b []byte) error {
  1079  	buf := codec.NewBuffer(b)
  1080  	m.Name = buf.DecodeString(64)
  1081  	m.AuthMethod = buf.DecodeUint8()
  1082  	m.IsHex = buf.DecodeBool()
  1083  	m.DataLen = buf.DecodeUint32()
  1084  	m.Data = make([]byte, m.DataLen)
  1085  	copy(m.Data, buf.DecodeBytes(len(m.Data)))
  1086  	return nil
  1087  }
  1088  
  1089  // Ikev2ProfileSetAuthReply defines message 'ikev2_profile_set_auth_reply'.
  1090  // InProgress: the message form may change in the future versions
  1091  type Ikev2ProfileSetAuthReply struct {
  1092  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1093  }
  1094  
  1095  func (m *Ikev2ProfileSetAuthReply) Reset()               { *m = Ikev2ProfileSetAuthReply{} }
  1096  func (*Ikev2ProfileSetAuthReply) GetMessageName() string { return "ikev2_profile_set_auth_reply" }
  1097  func (*Ikev2ProfileSetAuthReply) GetCrcString() string   { return "e8d4e804" }
  1098  func (*Ikev2ProfileSetAuthReply) GetMessageType() api.MessageType {
  1099  	return api.ReplyMessage
  1100  }
  1101  
  1102  func (m *Ikev2ProfileSetAuthReply) Size() (size int) {
  1103  	if m == nil {
  1104  		return 0
  1105  	}
  1106  	size += 4 // m.Retval
  1107  	return size
  1108  }
  1109  func (m *Ikev2ProfileSetAuthReply) Marshal(b []byte) ([]byte, error) {
  1110  	if b == nil {
  1111  		b = make([]byte, m.Size())
  1112  	}
  1113  	buf := codec.NewBuffer(b)
  1114  	buf.EncodeInt32(m.Retval)
  1115  	return buf.Bytes(), nil
  1116  }
  1117  func (m *Ikev2ProfileSetAuthReply) Unmarshal(b []byte) error {
  1118  	buf := codec.NewBuffer(b)
  1119  	m.Retval = buf.DecodeInt32()
  1120  	return nil
  1121  }
  1122  
  1123  // IKEv2: Set IKEv2 profile local/remote identification
  1124  //   - name - IKEv2 profile name
  1125  //   - is_local - Identification is local if non-zero, else remote
  1126  //   - id_type - Identification type
  1127  //   - data_len - Identification data length
  1128  //   - data - Identification data
  1129  //
  1130  // Ikev2ProfileSetID defines message 'ikev2_profile_set_id'.
  1131  // InProgress: the message form may change in the future versions
  1132  type Ikev2ProfileSetID struct {
  1133  	Name    string `binapi:"string[64],name=name" json:"name,omitempty"`
  1134  	IsLocal bool   `binapi:"bool,name=is_local" json:"is_local,omitempty"`
  1135  	IDType  uint8  `binapi:"u8,name=id_type" json:"id_type,omitempty"`
  1136  	DataLen uint32 `binapi:"u32,name=data_len" json:"-"`
  1137  	Data    []byte `binapi:"u8[data_len],name=data" json:"data,omitempty"`
  1138  }
  1139  
  1140  func (m *Ikev2ProfileSetID) Reset()               { *m = Ikev2ProfileSetID{} }
  1141  func (*Ikev2ProfileSetID) GetMessageName() string { return "ikev2_profile_set_id" }
  1142  func (*Ikev2ProfileSetID) GetCrcString() string   { return "4d7e2418" }
  1143  func (*Ikev2ProfileSetID) GetMessageType() api.MessageType {
  1144  	return api.RequestMessage
  1145  }
  1146  
  1147  func (m *Ikev2ProfileSetID) Size() (size int) {
  1148  	if m == nil {
  1149  		return 0
  1150  	}
  1151  	size += 64              // m.Name
  1152  	size += 1               // m.IsLocal
  1153  	size += 1               // m.IDType
  1154  	size += 4               // m.DataLen
  1155  	size += 1 * len(m.Data) // m.Data
  1156  	return size
  1157  }
  1158  func (m *Ikev2ProfileSetID) Marshal(b []byte) ([]byte, error) {
  1159  	if b == nil {
  1160  		b = make([]byte, m.Size())
  1161  	}
  1162  	buf := codec.NewBuffer(b)
  1163  	buf.EncodeString(m.Name, 64)
  1164  	buf.EncodeBool(m.IsLocal)
  1165  	buf.EncodeUint8(m.IDType)
  1166  	buf.EncodeUint32(uint32(len(m.Data)))
  1167  	buf.EncodeBytes(m.Data, 0)
  1168  	return buf.Bytes(), nil
  1169  }
  1170  func (m *Ikev2ProfileSetID) Unmarshal(b []byte) error {
  1171  	buf := codec.NewBuffer(b)
  1172  	m.Name = buf.DecodeString(64)
  1173  	m.IsLocal = buf.DecodeBool()
  1174  	m.IDType = buf.DecodeUint8()
  1175  	m.DataLen = buf.DecodeUint32()
  1176  	m.Data = make([]byte, m.DataLen)
  1177  	copy(m.Data, buf.DecodeBytes(len(m.Data)))
  1178  	return nil
  1179  }
  1180  
  1181  // Ikev2ProfileSetIDReply defines message 'ikev2_profile_set_id_reply'.
  1182  // InProgress: the message form may change in the future versions
  1183  type Ikev2ProfileSetIDReply struct {
  1184  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1185  }
  1186  
  1187  func (m *Ikev2ProfileSetIDReply) Reset()               { *m = Ikev2ProfileSetIDReply{} }
  1188  func (*Ikev2ProfileSetIDReply) GetMessageName() string { return "ikev2_profile_set_id_reply" }
  1189  func (*Ikev2ProfileSetIDReply) GetCrcString() string   { return "e8d4e804" }
  1190  func (*Ikev2ProfileSetIDReply) GetMessageType() api.MessageType {
  1191  	return api.ReplyMessage
  1192  }
  1193  
  1194  func (m *Ikev2ProfileSetIDReply) Size() (size int) {
  1195  	if m == nil {
  1196  		return 0
  1197  	}
  1198  	size += 4 // m.Retval
  1199  	return size
  1200  }
  1201  func (m *Ikev2ProfileSetIDReply) Marshal(b []byte) ([]byte, error) {
  1202  	if b == nil {
  1203  		b = make([]byte, m.Size())
  1204  	}
  1205  	buf := codec.NewBuffer(b)
  1206  	buf.EncodeInt32(m.Retval)
  1207  	return buf.Bytes(), nil
  1208  }
  1209  func (m *Ikev2ProfileSetIDReply) Unmarshal(b []byte) error {
  1210  	buf := codec.NewBuffer(b)
  1211  	m.Retval = buf.DecodeInt32()
  1212  	return nil
  1213  }
  1214  
  1215  // IKEv2: Set/unset custom ipsec-over-udp port
  1216  //   - is_set - whether set or unset custom port
  1217  //   - port - port number
  1218  //   - name - IKEv2 profile name
  1219  //
  1220  // Ikev2ProfileSetIpsecUDPPort defines message 'ikev2_profile_set_ipsec_udp_port'.
  1221  // InProgress: the message form may change in the future versions
  1222  type Ikev2ProfileSetIpsecUDPPort struct {
  1223  	IsSet uint8  `binapi:"u8,name=is_set" json:"is_set,omitempty"`
  1224  	Port  uint16 `binapi:"u16,name=port" json:"port,omitempty"`
  1225  	Name  string `binapi:"string[64],name=name" json:"name,omitempty"`
  1226  }
  1227  
  1228  func (m *Ikev2ProfileSetIpsecUDPPort) Reset() { *m = Ikev2ProfileSetIpsecUDPPort{} }
  1229  func (*Ikev2ProfileSetIpsecUDPPort) GetMessageName() string {
  1230  	return "ikev2_profile_set_ipsec_udp_port"
  1231  }
  1232  func (*Ikev2ProfileSetIpsecUDPPort) GetCrcString() string { return "615ce758" }
  1233  func (*Ikev2ProfileSetIpsecUDPPort) GetMessageType() api.MessageType {
  1234  	return api.RequestMessage
  1235  }
  1236  
  1237  func (m *Ikev2ProfileSetIpsecUDPPort) Size() (size int) {
  1238  	if m == nil {
  1239  		return 0
  1240  	}
  1241  	size += 1  // m.IsSet
  1242  	size += 2  // m.Port
  1243  	size += 64 // m.Name
  1244  	return size
  1245  }
  1246  func (m *Ikev2ProfileSetIpsecUDPPort) Marshal(b []byte) ([]byte, error) {
  1247  	if b == nil {
  1248  		b = make([]byte, m.Size())
  1249  	}
  1250  	buf := codec.NewBuffer(b)
  1251  	buf.EncodeUint8(m.IsSet)
  1252  	buf.EncodeUint16(m.Port)
  1253  	buf.EncodeString(m.Name, 64)
  1254  	return buf.Bytes(), nil
  1255  }
  1256  func (m *Ikev2ProfileSetIpsecUDPPort) Unmarshal(b []byte) error {
  1257  	buf := codec.NewBuffer(b)
  1258  	m.IsSet = buf.DecodeUint8()
  1259  	m.Port = buf.DecodeUint16()
  1260  	m.Name = buf.DecodeString(64)
  1261  	return nil
  1262  }
  1263  
  1264  // Ikev2ProfileSetIpsecUDPPortReply defines message 'ikev2_profile_set_ipsec_udp_port_reply'.
  1265  // InProgress: the message form may change in the future versions
  1266  type Ikev2ProfileSetIpsecUDPPortReply struct {
  1267  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1268  }
  1269  
  1270  func (m *Ikev2ProfileSetIpsecUDPPortReply) Reset() { *m = Ikev2ProfileSetIpsecUDPPortReply{} }
  1271  func (*Ikev2ProfileSetIpsecUDPPortReply) GetMessageName() string {
  1272  	return "ikev2_profile_set_ipsec_udp_port_reply"
  1273  }
  1274  func (*Ikev2ProfileSetIpsecUDPPortReply) GetCrcString() string { return "e8d4e804" }
  1275  func (*Ikev2ProfileSetIpsecUDPPortReply) GetMessageType() api.MessageType {
  1276  	return api.ReplyMessage
  1277  }
  1278  
  1279  func (m *Ikev2ProfileSetIpsecUDPPortReply) Size() (size int) {
  1280  	if m == nil {
  1281  		return 0
  1282  	}
  1283  	size += 4 // m.Retval
  1284  	return size
  1285  }
  1286  func (m *Ikev2ProfileSetIpsecUDPPortReply) Marshal(b []byte) ([]byte, error) {
  1287  	if b == nil {
  1288  		b = make([]byte, m.Size())
  1289  	}
  1290  	buf := codec.NewBuffer(b)
  1291  	buf.EncodeInt32(m.Retval)
  1292  	return buf.Bytes(), nil
  1293  }
  1294  func (m *Ikev2ProfileSetIpsecUDPPortReply) Unmarshal(b []byte) error {
  1295  	buf := codec.NewBuffer(b)
  1296  	m.Retval = buf.DecodeInt32()
  1297  	return nil
  1298  }
  1299  
  1300  // IKEv2: Set liveness parameters
  1301  //   - period - how often is liveness check performed
  1302  //   - max_retries - max retries for liveness check
  1303  //
  1304  // Ikev2ProfileSetLiveness defines message 'ikev2_profile_set_liveness'.
  1305  // InProgress: the message form may change in the future versions
  1306  type Ikev2ProfileSetLiveness struct {
  1307  	Period     uint32 `binapi:"u32,name=period" json:"period,omitempty"`
  1308  	MaxRetries uint32 `binapi:"u32,name=max_retries" json:"max_retries,omitempty"`
  1309  }
  1310  
  1311  func (m *Ikev2ProfileSetLiveness) Reset()               { *m = Ikev2ProfileSetLiveness{} }
  1312  func (*Ikev2ProfileSetLiveness) GetMessageName() string { return "ikev2_profile_set_liveness" }
  1313  func (*Ikev2ProfileSetLiveness) GetCrcString() string   { return "6bdf4d65" }
  1314  func (*Ikev2ProfileSetLiveness) GetMessageType() api.MessageType {
  1315  	return api.RequestMessage
  1316  }
  1317  
  1318  func (m *Ikev2ProfileSetLiveness) Size() (size int) {
  1319  	if m == nil {
  1320  		return 0
  1321  	}
  1322  	size += 4 // m.Period
  1323  	size += 4 // m.MaxRetries
  1324  	return size
  1325  }
  1326  func (m *Ikev2ProfileSetLiveness) Marshal(b []byte) ([]byte, error) {
  1327  	if b == nil {
  1328  		b = make([]byte, m.Size())
  1329  	}
  1330  	buf := codec.NewBuffer(b)
  1331  	buf.EncodeUint32(m.Period)
  1332  	buf.EncodeUint32(m.MaxRetries)
  1333  	return buf.Bytes(), nil
  1334  }
  1335  func (m *Ikev2ProfileSetLiveness) Unmarshal(b []byte) error {
  1336  	buf := codec.NewBuffer(b)
  1337  	m.Period = buf.DecodeUint32()
  1338  	m.MaxRetries = buf.DecodeUint32()
  1339  	return nil
  1340  }
  1341  
  1342  // Ikev2ProfileSetLivenessReply defines message 'ikev2_profile_set_liveness_reply'.
  1343  // InProgress: the message form may change in the future versions
  1344  type Ikev2ProfileSetLivenessReply struct {
  1345  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1346  }
  1347  
  1348  func (m *Ikev2ProfileSetLivenessReply) Reset() { *m = Ikev2ProfileSetLivenessReply{} }
  1349  func (*Ikev2ProfileSetLivenessReply) GetMessageName() string {
  1350  	return "ikev2_profile_set_liveness_reply"
  1351  }
  1352  func (*Ikev2ProfileSetLivenessReply) GetCrcString() string { return "e8d4e804" }
  1353  func (*Ikev2ProfileSetLivenessReply) GetMessageType() api.MessageType {
  1354  	return api.ReplyMessage
  1355  }
  1356  
  1357  func (m *Ikev2ProfileSetLivenessReply) Size() (size int) {
  1358  	if m == nil {
  1359  		return 0
  1360  	}
  1361  	size += 4 // m.Retval
  1362  	return size
  1363  }
  1364  func (m *Ikev2ProfileSetLivenessReply) Marshal(b []byte) ([]byte, error) {
  1365  	if b == nil {
  1366  		b = make([]byte, m.Size())
  1367  	}
  1368  	buf := codec.NewBuffer(b)
  1369  	buf.EncodeInt32(m.Retval)
  1370  	return buf.Bytes(), nil
  1371  }
  1372  func (m *Ikev2ProfileSetLivenessReply) Unmarshal(b []byte) error {
  1373  	buf := codec.NewBuffer(b)
  1374  	m.Retval = buf.DecodeInt32()
  1375  	return nil
  1376  }
  1377  
  1378  // IKEv2: Set IKEv2 profile traffic selector parameters
  1379  //   - name - IKEv2 profile name
  1380  //   - ts - traffic selector data
  1381  //
  1382  // Ikev2ProfileSetTs defines message 'ikev2_profile_set_ts'.
  1383  // InProgress: the message form may change in the future versions
  1384  type Ikev2ProfileSetTs struct {
  1385  	Name string              `binapi:"string[64],name=name" json:"name,omitempty"`
  1386  	Ts   ikev2_types.Ikev2Ts `binapi:"ikev2_ts,name=ts" json:"ts,omitempty"`
  1387  }
  1388  
  1389  func (m *Ikev2ProfileSetTs) Reset()               { *m = Ikev2ProfileSetTs{} }
  1390  func (*Ikev2ProfileSetTs) GetMessageName() string { return "ikev2_profile_set_ts" }
  1391  func (*Ikev2ProfileSetTs) GetCrcString() string   { return "8eb8cfd1" }
  1392  func (*Ikev2ProfileSetTs) GetMessageType() api.MessageType {
  1393  	return api.RequestMessage
  1394  }
  1395  
  1396  func (m *Ikev2ProfileSetTs) Size() (size int) {
  1397  	if m == nil {
  1398  		return 0
  1399  	}
  1400  	size += 64     // m.Name
  1401  	size += 4      // m.Ts.SaIndex
  1402  	size += 4      // m.Ts.ChildSaIndex
  1403  	size += 1      // m.Ts.IsLocal
  1404  	size += 1      // m.Ts.ProtocolID
  1405  	size += 2      // m.Ts.StartPort
  1406  	size += 2      // m.Ts.EndPort
  1407  	size += 1      // m.Ts.StartAddr.Af
  1408  	size += 1 * 16 // m.Ts.StartAddr.Un
  1409  	size += 1      // m.Ts.EndAddr.Af
  1410  	size += 1 * 16 // m.Ts.EndAddr.Un
  1411  	return size
  1412  }
  1413  func (m *Ikev2ProfileSetTs) Marshal(b []byte) ([]byte, error) {
  1414  	if b == nil {
  1415  		b = make([]byte, m.Size())
  1416  	}
  1417  	buf := codec.NewBuffer(b)
  1418  	buf.EncodeString(m.Name, 64)
  1419  	buf.EncodeUint32(m.Ts.SaIndex)
  1420  	buf.EncodeUint32(m.Ts.ChildSaIndex)
  1421  	buf.EncodeBool(m.Ts.IsLocal)
  1422  	buf.EncodeUint8(m.Ts.ProtocolID)
  1423  	buf.EncodeUint16(m.Ts.StartPort)
  1424  	buf.EncodeUint16(m.Ts.EndPort)
  1425  	buf.EncodeUint8(uint8(m.Ts.StartAddr.Af))
  1426  	buf.EncodeBytes(m.Ts.StartAddr.Un.XXX_UnionData[:], 16)
  1427  	buf.EncodeUint8(uint8(m.Ts.EndAddr.Af))
  1428  	buf.EncodeBytes(m.Ts.EndAddr.Un.XXX_UnionData[:], 16)
  1429  	return buf.Bytes(), nil
  1430  }
  1431  func (m *Ikev2ProfileSetTs) Unmarshal(b []byte) error {
  1432  	buf := codec.NewBuffer(b)
  1433  	m.Name = buf.DecodeString(64)
  1434  	m.Ts.SaIndex = buf.DecodeUint32()
  1435  	m.Ts.ChildSaIndex = buf.DecodeUint32()
  1436  	m.Ts.IsLocal = buf.DecodeBool()
  1437  	m.Ts.ProtocolID = buf.DecodeUint8()
  1438  	m.Ts.StartPort = buf.DecodeUint16()
  1439  	m.Ts.EndPort = buf.DecodeUint16()
  1440  	m.Ts.StartAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
  1441  	copy(m.Ts.StartAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  1442  	m.Ts.EndAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
  1443  	copy(m.Ts.EndAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  1444  	return nil
  1445  }
  1446  
  1447  // Ikev2ProfileSetTsReply defines message 'ikev2_profile_set_ts_reply'.
  1448  // InProgress: the message form may change in the future versions
  1449  type Ikev2ProfileSetTsReply struct {
  1450  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1451  }
  1452  
  1453  func (m *Ikev2ProfileSetTsReply) Reset()               { *m = Ikev2ProfileSetTsReply{} }
  1454  func (*Ikev2ProfileSetTsReply) GetMessageName() string { return "ikev2_profile_set_ts_reply" }
  1455  func (*Ikev2ProfileSetTsReply) GetCrcString() string   { return "e8d4e804" }
  1456  func (*Ikev2ProfileSetTsReply) GetMessageType() api.MessageType {
  1457  	return api.ReplyMessage
  1458  }
  1459  
  1460  func (m *Ikev2ProfileSetTsReply) Size() (size int) {
  1461  	if m == nil {
  1462  		return 0
  1463  	}
  1464  	size += 4 // m.Retval
  1465  	return size
  1466  }
  1467  func (m *Ikev2ProfileSetTsReply) Marshal(b []byte) ([]byte, error) {
  1468  	if b == nil {
  1469  		b = make([]byte, m.Size())
  1470  	}
  1471  	buf := codec.NewBuffer(b)
  1472  	buf.EncodeInt32(m.Retval)
  1473  	return buf.Bytes(), nil
  1474  }
  1475  func (m *Ikev2ProfileSetTsReply) Unmarshal(b []byte) error {
  1476  	buf := codec.NewBuffer(b)
  1477  	m.Retval = buf.DecodeInt32()
  1478  	return nil
  1479  }
  1480  
  1481  // IKEv2: Set UDP encapsulation
  1482  //   - name - IKEv2 profile name
  1483  //
  1484  // Ikev2ProfileSetUDPEncap defines message 'ikev2_profile_set_udp_encap'.
  1485  // InProgress: the message form may change in the future versions
  1486  type Ikev2ProfileSetUDPEncap struct {
  1487  	Name string `binapi:"string[64],name=name" json:"name,omitempty"`
  1488  }
  1489  
  1490  func (m *Ikev2ProfileSetUDPEncap) Reset()               { *m = Ikev2ProfileSetUDPEncap{} }
  1491  func (*Ikev2ProfileSetUDPEncap) GetMessageName() string { return "ikev2_profile_set_udp_encap" }
  1492  func (*Ikev2ProfileSetUDPEncap) GetCrcString() string   { return "ebf79a66" }
  1493  func (*Ikev2ProfileSetUDPEncap) GetMessageType() api.MessageType {
  1494  	return api.RequestMessage
  1495  }
  1496  
  1497  func (m *Ikev2ProfileSetUDPEncap) Size() (size int) {
  1498  	if m == nil {
  1499  		return 0
  1500  	}
  1501  	size += 64 // m.Name
  1502  	return size
  1503  }
  1504  func (m *Ikev2ProfileSetUDPEncap) Marshal(b []byte) ([]byte, error) {
  1505  	if b == nil {
  1506  		b = make([]byte, m.Size())
  1507  	}
  1508  	buf := codec.NewBuffer(b)
  1509  	buf.EncodeString(m.Name, 64)
  1510  	return buf.Bytes(), nil
  1511  }
  1512  func (m *Ikev2ProfileSetUDPEncap) Unmarshal(b []byte) error {
  1513  	buf := codec.NewBuffer(b)
  1514  	m.Name = buf.DecodeString(64)
  1515  	return nil
  1516  }
  1517  
  1518  // Ikev2ProfileSetUDPEncapReply defines message 'ikev2_profile_set_udp_encap_reply'.
  1519  // InProgress: the message form may change in the future versions
  1520  type Ikev2ProfileSetUDPEncapReply struct {
  1521  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1522  }
  1523  
  1524  func (m *Ikev2ProfileSetUDPEncapReply) Reset() { *m = Ikev2ProfileSetUDPEncapReply{} }
  1525  func (*Ikev2ProfileSetUDPEncapReply) GetMessageName() string {
  1526  	return "ikev2_profile_set_udp_encap_reply"
  1527  }
  1528  func (*Ikev2ProfileSetUDPEncapReply) GetCrcString() string { return "e8d4e804" }
  1529  func (*Ikev2ProfileSetUDPEncapReply) GetMessageType() api.MessageType {
  1530  	return api.ReplyMessage
  1531  }
  1532  
  1533  func (m *Ikev2ProfileSetUDPEncapReply) Size() (size int) {
  1534  	if m == nil {
  1535  		return 0
  1536  	}
  1537  	size += 4 // m.Retval
  1538  	return size
  1539  }
  1540  func (m *Ikev2ProfileSetUDPEncapReply) Marshal(b []byte) ([]byte, error) {
  1541  	if b == nil {
  1542  		b = make([]byte, m.Size())
  1543  	}
  1544  	buf := codec.NewBuffer(b)
  1545  	buf.EncodeInt32(m.Retval)
  1546  	return buf.Bytes(), nil
  1547  }
  1548  func (m *Ikev2ProfileSetUDPEncapReply) Unmarshal(b []byte) error {
  1549  	buf := codec.NewBuffer(b)
  1550  	m.Retval = buf.DecodeInt32()
  1551  	return nil
  1552  }
  1553  
  1554  // Details about IKE SA
  1555  //   - retval - return code
  1556  //   - sa - SA data
  1557  //
  1558  // Ikev2SaDetails defines message 'ikev2_sa_details'.
  1559  // InProgress: the message form may change in the future versions
  1560  type Ikev2SaDetails struct {
  1561  	Retval int32               `binapi:"i32,name=retval" json:"retval,omitempty"`
  1562  	Sa     ikev2_types.Ikev2Sa `binapi:"ikev2_sa,name=sa" json:"sa,omitempty"`
  1563  }
  1564  
  1565  func (m *Ikev2SaDetails) Reset()               { *m = Ikev2SaDetails{} }
  1566  func (*Ikev2SaDetails) GetMessageName() string { return "ikev2_sa_details" }
  1567  func (*Ikev2SaDetails) GetCrcString() string   { return "937c22d5" }
  1568  func (*Ikev2SaDetails) GetMessageType() api.MessageType {
  1569  	return api.ReplyMessage
  1570  }
  1571  
  1572  func (m *Ikev2SaDetails) Size() (size int) {
  1573  	if m == nil {
  1574  		return 0
  1575  	}
  1576  	size += 4      // m.Retval
  1577  	size += 4      // m.Sa.SaIndex
  1578  	size += 4      // m.Sa.ProfileIndex
  1579  	size += 8      // m.Sa.Ispi
  1580  	size += 8      // m.Sa.Rspi
  1581  	size += 1      // m.Sa.Iaddr.Af
  1582  	size += 1 * 16 // m.Sa.Iaddr.Un
  1583  	size += 1      // m.Sa.Raddr.Af
  1584  	size += 1 * 16 // m.Sa.Raddr.Un
  1585  	size += 1 * 64 // m.Sa.Keys.SkD
  1586  	size += 1      // m.Sa.Keys.SkDLen
  1587  	size += 1 * 64 // m.Sa.Keys.SkAi
  1588  	size += 1      // m.Sa.Keys.SkAiLen
  1589  	size += 1 * 64 // m.Sa.Keys.SkAr
  1590  	size += 1      // m.Sa.Keys.SkArLen
  1591  	size += 1 * 64 // m.Sa.Keys.SkEi
  1592  	size += 1      // m.Sa.Keys.SkEiLen
  1593  	size += 1 * 64 // m.Sa.Keys.SkEr
  1594  	size += 1      // m.Sa.Keys.SkErLen
  1595  	size += 1 * 64 // m.Sa.Keys.SkPi
  1596  	size += 1      // m.Sa.Keys.SkPiLen
  1597  	size += 1 * 64 // m.Sa.Keys.SkPr
  1598  	size += 1      // m.Sa.Keys.SkPrLen
  1599  	size += 1      // m.Sa.IID.Type
  1600  	size += 1      // m.Sa.IID.DataLen
  1601  	size += 64     // m.Sa.IID.Data
  1602  	size += 1      // m.Sa.RID.Type
  1603  	size += 1      // m.Sa.RID.DataLen
  1604  	size += 64     // m.Sa.RID.Data
  1605  	size += 1      // m.Sa.Encryption.TransformType
  1606  	size += 2      // m.Sa.Encryption.TransformID
  1607  	size += 2      // m.Sa.Encryption.KeyLen
  1608  	size += 2      // m.Sa.Encryption.KeyTrunc
  1609  	size += 2      // m.Sa.Encryption.BlockSize
  1610  	size += 1      // m.Sa.Encryption.DhGroup
  1611  	size += 1      // m.Sa.Integrity.TransformType
  1612  	size += 2      // m.Sa.Integrity.TransformID
  1613  	size += 2      // m.Sa.Integrity.KeyLen
  1614  	size += 2      // m.Sa.Integrity.KeyTrunc
  1615  	size += 2      // m.Sa.Integrity.BlockSize
  1616  	size += 1      // m.Sa.Integrity.DhGroup
  1617  	size += 1      // m.Sa.Prf.TransformType
  1618  	size += 2      // m.Sa.Prf.TransformID
  1619  	size += 2      // m.Sa.Prf.KeyLen
  1620  	size += 2      // m.Sa.Prf.KeyTrunc
  1621  	size += 2      // m.Sa.Prf.BlockSize
  1622  	size += 1      // m.Sa.Prf.DhGroup
  1623  	size += 1      // m.Sa.Dh.TransformType
  1624  	size += 2      // m.Sa.Dh.TransformID
  1625  	size += 2      // m.Sa.Dh.KeyLen
  1626  	size += 2      // m.Sa.Dh.KeyTrunc
  1627  	size += 2      // m.Sa.Dh.BlockSize
  1628  	size += 1      // m.Sa.Dh.DhGroup
  1629  	size += 2      // m.Sa.Stats.NKeepalives
  1630  	size += 2      // m.Sa.Stats.NRekeyReq
  1631  	size += 2      // m.Sa.Stats.NSaInitReq
  1632  	size += 2      // m.Sa.Stats.NSaAuthReq
  1633  	size += 2      // m.Sa.Stats.NRetransmit
  1634  	size += 2      // m.Sa.Stats.NInitSaRetransmit
  1635  	return size
  1636  }
  1637  func (m *Ikev2SaDetails) Marshal(b []byte) ([]byte, error) {
  1638  	if b == nil {
  1639  		b = make([]byte, m.Size())
  1640  	}
  1641  	buf := codec.NewBuffer(b)
  1642  	buf.EncodeInt32(m.Retval)
  1643  	buf.EncodeUint32(m.Sa.SaIndex)
  1644  	buf.EncodeUint32(m.Sa.ProfileIndex)
  1645  	buf.EncodeUint64(m.Sa.Ispi)
  1646  	buf.EncodeUint64(m.Sa.Rspi)
  1647  	buf.EncodeUint8(uint8(m.Sa.Iaddr.Af))
  1648  	buf.EncodeBytes(m.Sa.Iaddr.Un.XXX_UnionData[:], 16)
  1649  	buf.EncodeUint8(uint8(m.Sa.Raddr.Af))
  1650  	buf.EncodeBytes(m.Sa.Raddr.Un.XXX_UnionData[:], 16)
  1651  	buf.EncodeBytes(m.Sa.Keys.SkD, 64)
  1652  	buf.EncodeUint8(m.Sa.Keys.SkDLen)
  1653  	buf.EncodeBytes(m.Sa.Keys.SkAi, 64)
  1654  	buf.EncodeUint8(m.Sa.Keys.SkAiLen)
  1655  	buf.EncodeBytes(m.Sa.Keys.SkAr, 64)
  1656  	buf.EncodeUint8(m.Sa.Keys.SkArLen)
  1657  	buf.EncodeBytes(m.Sa.Keys.SkEi, 64)
  1658  	buf.EncodeUint8(m.Sa.Keys.SkEiLen)
  1659  	buf.EncodeBytes(m.Sa.Keys.SkEr, 64)
  1660  	buf.EncodeUint8(m.Sa.Keys.SkErLen)
  1661  	buf.EncodeBytes(m.Sa.Keys.SkPi, 64)
  1662  	buf.EncodeUint8(m.Sa.Keys.SkPiLen)
  1663  	buf.EncodeBytes(m.Sa.Keys.SkPr, 64)
  1664  	buf.EncodeUint8(m.Sa.Keys.SkPrLen)
  1665  	buf.EncodeUint8(m.Sa.IID.Type)
  1666  	buf.EncodeUint8(m.Sa.IID.DataLen)
  1667  	buf.EncodeString(m.Sa.IID.Data, 64)
  1668  	buf.EncodeUint8(m.Sa.RID.Type)
  1669  	buf.EncodeUint8(m.Sa.RID.DataLen)
  1670  	buf.EncodeString(m.Sa.RID.Data, 64)
  1671  	buf.EncodeUint8(m.Sa.Encryption.TransformType)
  1672  	buf.EncodeUint16(m.Sa.Encryption.TransformID)
  1673  	buf.EncodeUint16(m.Sa.Encryption.KeyLen)
  1674  	buf.EncodeUint16(m.Sa.Encryption.KeyTrunc)
  1675  	buf.EncodeUint16(m.Sa.Encryption.BlockSize)
  1676  	buf.EncodeUint8(m.Sa.Encryption.DhGroup)
  1677  	buf.EncodeUint8(m.Sa.Integrity.TransformType)
  1678  	buf.EncodeUint16(m.Sa.Integrity.TransformID)
  1679  	buf.EncodeUint16(m.Sa.Integrity.KeyLen)
  1680  	buf.EncodeUint16(m.Sa.Integrity.KeyTrunc)
  1681  	buf.EncodeUint16(m.Sa.Integrity.BlockSize)
  1682  	buf.EncodeUint8(m.Sa.Integrity.DhGroup)
  1683  	buf.EncodeUint8(m.Sa.Prf.TransformType)
  1684  	buf.EncodeUint16(m.Sa.Prf.TransformID)
  1685  	buf.EncodeUint16(m.Sa.Prf.KeyLen)
  1686  	buf.EncodeUint16(m.Sa.Prf.KeyTrunc)
  1687  	buf.EncodeUint16(m.Sa.Prf.BlockSize)
  1688  	buf.EncodeUint8(m.Sa.Prf.DhGroup)
  1689  	buf.EncodeUint8(m.Sa.Dh.TransformType)
  1690  	buf.EncodeUint16(m.Sa.Dh.TransformID)
  1691  	buf.EncodeUint16(m.Sa.Dh.KeyLen)
  1692  	buf.EncodeUint16(m.Sa.Dh.KeyTrunc)
  1693  	buf.EncodeUint16(m.Sa.Dh.BlockSize)
  1694  	buf.EncodeUint8(m.Sa.Dh.DhGroup)
  1695  	buf.EncodeUint16(m.Sa.Stats.NKeepalives)
  1696  	buf.EncodeUint16(m.Sa.Stats.NRekeyReq)
  1697  	buf.EncodeUint16(m.Sa.Stats.NSaInitReq)
  1698  	buf.EncodeUint16(m.Sa.Stats.NSaAuthReq)
  1699  	buf.EncodeUint16(m.Sa.Stats.NRetransmit)
  1700  	buf.EncodeUint16(m.Sa.Stats.NInitSaRetransmit)
  1701  	return buf.Bytes(), nil
  1702  }
  1703  func (m *Ikev2SaDetails) Unmarshal(b []byte) error {
  1704  	buf := codec.NewBuffer(b)
  1705  	m.Retval = buf.DecodeInt32()
  1706  	m.Sa.SaIndex = buf.DecodeUint32()
  1707  	m.Sa.ProfileIndex = buf.DecodeUint32()
  1708  	m.Sa.Ispi = buf.DecodeUint64()
  1709  	m.Sa.Rspi = buf.DecodeUint64()
  1710  	m.Sa.Iaddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
  1711  	copy(m.Sa.Iaddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  1712  	m.Sa.Raddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
  1713  	copy(m.Sa.Raddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  1714  	m.Sa.Keys.SkD = make([]byte, 64)
  1715  	copy(m.Sa.Keys.SkD, buf.DecodeBytes(len(m.Sa.Keys.SkD)))
  1716  	m.Sa.Keys.SkDLen = buf.DecodeUint8()
  1717  	m.Sa.Keys.SkAi = make([]byte, 64)
  1718  	copy(m.Sa.Keys.SkAi, buf.DecodeBytes(len(m.Sa.Keys.SkAi)))
  1719  	m.Sa.Keys.SkAiLen = buf.DecodeUint8()
  1720  	m.Sa.Keys.SkAr = make([]byte, 64)
  1721  	copy(m.Sa.Keys.SkAr, buf.DecodeBytes(len(m.Sa.Keys.SkAr)))
  1722  	m.Sa.Keys.SkArLen = buf.DecodeUint8()
  1723  	m.Sa.Keys.SkEi = make([]byte, 64)
  1724  	copy(m.Sa.Keys.SkEi, buf.DecodeBytes(len(m.Sa.Keys.SkEi)))
  1725  	m.Sa.Keys.SkEiLen = buf.DecodeUint8()
  1726  	m.Sa.Keys.SkEr = make([]byte, 64)
  1727  	copy(m.Sa.Keys.SkEr, buf.DecodeBytes(len(m.Sa.Keys.SkEr)))
  1728  	m.Sa.Keys.SkErLen = buf.DecodeUint8()
  1729  	m.Sa.Keys.SkPi = make([]byte, 64)
  1730  	copy(m.Sa.Keys.SkPi, buf.DecodeBytes(len(m.Sa.Keys.SkPi)))
  1731  	m.Sa.Keys.SkPiLen = buf.DecodeUint8()
  1732  	m.Sa.Keys.SkPr = make([]byte, 64)
  1733  	copy(m.Sa.Keys.SkPr, buf.DecodeBytes(len(m.Sa.Keys.SkPr)))
  1734  	m.Sa.Keys.SkPrLen = buf.DecodeUint8()
  1735  	m.Sa.IID.Type = buf.DecodeUint8()
  1736  	m.Sa.IID.DataLen = buf.DecodeUint8()
  1737  	m.Sa.IID.Data = buf.DecodeString(64)
  1738  	m.Sa.RID.Type = buf.DecodeUint8()
  1739  	m.Sa.RID.DataLen = buf.DecodeUint8()
  1740  	m.Sa.RID.Data = buf.DecodeString(64)
  1741  	m.Sa.Encryption.TransformType = buf.DecodeUint8()
  1742  	m.Sa.Encryption.TransformID = buf.DecodeUint16()
  1743  	m.Sa.Encryption.KeyLen = buf.DecodeUint16()
  1744  	m.Sa.Encryption.KeyTrunc = buf.DecodeUint16()
  1745  	m.Sa.Encryption.BlockSize = buf.DecodeUint16()
  1746  	m.Sa.Encryption.DhGroup = buf.DecodeUint8()
  1747  	m.Sa.Integrity.TransformType = buf.DecodeUint8()
  1748  	m.Sa.Integrity.TransformID = buf.DecodeUint16()
  1749  	m.Sa.Integrity.KeyLen = buf.DecodeUint16()
  1750  	m.Sa.Integrity.KeyTrunc = buf.DecodeUint16()
  1751  	m.Sa.Integrity.BlockSize = buf.DecodeUint16()
  1752  	m.Sa.Integrity.DhGroup = buf.DecodeUint8()
  1753  	m.Sa.Prf.TransformType = buf.DecodeUint8()
  1754  	m.Sa.Prf.TransformID = buf.DecodeUint16()
  1755  	m.Sa.Prf.KeyLen = buf.DecodeUint16()
  1756  	m.Sa.Prf.KeyTrunc = buf.DecodeUint16()
  1757  	m.Sa.Prf.BlockSize = buf.DecodeUint16()
  1758  	m.Sa.Prf.DhGroup = buf.DecodeUint8()
  1759  	m.Sa.Dh.TransformType = buf.DecodeUint8()
  1760  	m.Sa.Dh.TransformID = buf.DecodeUint16()
  1761  	m.Sa.Dh.KeyLen = buf.DecodeUint16()
  1762  	m.Sa.Dh.KeyTrunc = buf.DecodeUint16()
  1763  	m.Sa.Dh.BlockSize = buf.DecodeUint16()
  1764  	m.Sa.Dh.DhGroup = buf.DecodeUint8()
  1765  	m.Sa.Stats.NKeepalives = buf.DecodeUint16()
  1766  	m.Sa.Stats.NRekeyReq = buf.DecodeUint16()
  1767  	m.Sa.Stats.NSaInitReq = buf.DecodeUint16()
  1768  	m.Sa.Stats.NSaAuthReq = buf.DecodeUint16()
  1769  	m.Sa.Stats.NRetransmit = buf.DecodeUint16()
  1770  	m.Sa.Stats.NInitSaRetransmit = buf.DecodeUint16()
  1771  	return nil
  1772  }
  1773  
  1774  // Dump all SAs
  1775  // Ikev2SaDump defines message 'ikev2_sa_dump'.
  1776  // InProgress: the message form may change in the future versions
  1777  type Ikev2SaDump struct{}
  1778  
  1779  func (m *Ikev2SaDump) Reset()               { *m = Ikev2SaDump{} }
  1780  func (*Ikev2SaDump) GetMessageName() string { return "ikev2_sa_dump" }
  1781  func (*Ikev2SaDump) GetCrcString() string   { return "51077d14" }
  1782  func (*Ikev2SaDump) GetMessageType() api.MessageType {
  1783  	return api.RequestMessage
  1784  }
  1785  
  1786  func (m *Ikev2SaDump) Size() (size int) {
  1787  	if m == nil {
  1788  		return 0
  1789  	}
  1790  	return size
  1791  }
  1792  func (m *Ikev2SaDump) Marshal(b []byte) ([]byte, error) {
  1793  	if b == nil {
  1794  		b = make([]byte, m.Size())
  1795  	}
  1796  	buf := codec.NewBuffer(b)
  1797  	return buf.Bytes(), nil
  1798  }
  1799  func (m *Ikev2SaDump) Unmarshal(b []byte) error {
  1800  	return nil
  1801  }
  1802  
  1803  // IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
  1804  //   - name - IKEv2 profile name
  1805  //   - tr - ESP transforms
  1806  //
  1807  // Ikev2SetEspTransforms defines message 'ikev2_set_esp_transforms'.
  1808  // InProgress: the message form may change in the future versions
  1809  type Ikev2SetEspTransforms struct {
  1810  	Name string                         `binapi:"string[64],name=name" json:"name,omitempty"`
  1811  	Tr   ikev2_types.Ikev2EspTransforms `binapi:"ikev2_esp_transforms,name=tr" json:"tr,omitempty"`
  1812  }
  1813  
  1814  func (m *Ikev2SetEspTransforms) Reset()               { *m = Ikev2SetEspTransforms{} }
  1815  func (*Ikev2SetEspTransforms) GetMessageName() string { return "ikev2_set_esp_transforms" }
  1816  func (*Ikev2SetEspTransforms) GetCrcString() string   { return "a63dc205" }
  1817  func (*Ikev2SetEspTransforms) GetMessageType() api.MessageType {
  1818  	return api.RequestMessage
  1819  }
  1820  
  1821  func (m *Ikev2SetEspTransforms) Size() (size int) {
  1822  	if m == nil {
  1823  		return 0
  1824  	}
  1825  	size += 64 // m.Name
  1826  	size += 1  // m.Tr.CryptoAlg
  1827  	size += 4  // m.Tr.CryptoKeySize
  1828  	size += 1  // m.Tr.IntegAlg
  1829  	return size
  1830  }
  1831  func (m *Ikev2SetEspTransforms) Marshal(b []byte) ([]byte, error) {
  1832  	if b == nil {
  1833  		b = make([]byte, m.Size())
  1834  	}
  1835  	buf := codec.NewBuffer(b)
  1836  	buf.EncodeString(m.Name, 64)
  1837  	buf.EncodeUint8(m.Tr.CryptoAlg)
  1838  	buf.EncodeUint32(m.Tr.CryptoKeySize)
  1839  	buf.EncodeUint8(m.Tr.IntegAlg)
  1840  	return buf.Bytes(), nil
  1841  }
  1842  func (m *Ikev2SetEspTransforms) Unmarshal(b []byte) error {
  1843  	buf := codec.NewBuffer(b)
  1844  	m.Name = buf.DecodeString(64)
  1845  	m.Tr.CryptoAlg = buf.DecodeUint8()
  1846  	m.Tr.CryptoKeySize = buf.DecodeUint32()
  1847  	m.Tr.IntegAlg = buf.DecodeUint8()
  1848  	return nil
  1849  }
  1850  
  1851  // Ikev2SetEspTransformsReply defines message 'ikev2_set_esp_transforms_reply'.
  1852  // InProgress: the message form may change in the future versions
  1853  type Ikev2SetEspTransformsReply struct {
  1854  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1855  }
  1856  
  1857  func (m *Ikev2SetEspTransformsReply) Reset()               { *m = Ikev2SetEspTransformsReply{} }
  1858  func (*Ikev2SetEspTransformsReply) GetMessageName() string { return "ikev2_set_esp_transforms_reply" }
  1859  func (*Ikev2SetEspTransformsReply) GetCrcString() string   { return "e8d4e804" }
  1860  func (*Ikev2SetEspTransformsReply) GetMessageType() api.MessageType {
  1861  	return api.ReplyMessage
  1862  }
  1863  
  1864  func (m *Ikev2SetEspTransformsReply) Size() (size int) {
  1865  	if m == nil {
  1866  		return 0
  1867  	}
  1868  	size += 4 // m.Retval
  1869  	return size
  1870  }
  1871  func (m *Ikev2SetEspTransformsReply) Marshal(b []byte) ([]byte, error) {
  1872  	if b == nil {
  1873  		b = make([]byte, m.Size())
  1874  	}
  1875  	buf := codec.NewBuffer(b)
  1876  	buf.EncodeInt32(m.Retval)
  1877  	return buf.Bytes(), nil
  1878  }
  1879  func (m *Ikev2SetEspTransformsReply) Unmarshal(b []byte) error {
  1880  	buf := codec.NewBuffer(b)
  1881  	m.Retval = buf.DecodeInt32()
  1882  	return nil
  1883  }
  1884  
  1885  // IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
  1886  //   - name - IKEv2 profile name
  1887  //   - tr - IKE transforms
  1888  //
  1889  // Ikev2SetIkeTransforms defines message 'ikev2_set_ike_transforms'.
  1890  // InProgress: the message form may change in the future versions
  1891  type Ikev2SetIkeTransforms struct {
  1892  	Name string                         `binapi:"string[64],name=name" json:"name,omitempty"`
  1893  	Tr   ikev2_types.Ikev2IkeTransforms `binapi:"ikev2_ike_transforms,name=tr" json:"tr,omitempty"`
  1894  }
  1895  
  1896  func (m *Ikev2SetIkeTransforms) Reset()               { *m = Ikev2SetIkeTransforms{} }
  1897  func (*Ikev2SetIkeTransforms) GetMessageName() string { return "ikev2_set_ike_transforms" }
  1898  func (*Ikev2SetIkeTransforms) GetCrcString() string   { return "076d7378" }
  1899  func (*Ikev2SetIkeTransforms) GetMessageType() api.MessageType {
  1900  	return api.RequestMessage
  1901  }
  1902  
  1903  func (m *Ikev2SetIkeTransforms) Size() (size int) {
  1904  	if m == nil {
  1905  		return 0
  1906  	}
  1907  	size += 64 // m.Name
  1908  	size += 1  // m.Tr.CryptoAlg
  1909  	size += 4  // m.Tr.CryptoKeySize
  1910  	size += 1  // m.Tr.IntegAlg
  1911  	size += 1  // m.Tr.DhGroup
  1912  	return size
  1913  }
  1914  func (m *Ikev2SetIkeTransforms) Marshal(b []byte) ([]byte, error) {
  1915  	if b == nil {
  1916  		b = make([]byte, m.Size())
  1917  	}
  1918  	buf := codec.NewBuffer(b)
  1919  	buf.EncodeString(m.Name, 64)
  1920  	buf.EncodeUint8(m.Tr.CryptoAlg)
  1921  	buf.EncodeUint32(m.Tr.CryptoKeySize)
  1922  	buf.EncodeUint8(m.Tr.IntegAlg)
  1923  	buf.EncodeUint8(m.Tr.DhGroup)
  1924  	return buf.Bytes(), nil
  1925  }
  1926  func (m *Ikev2SetIkeTransforms) Unmarshal(b []byte) error {
  1927  	buf := codec.NewBuffer(b)
  1928  	m.Name = buf.DecodeString(64)
  1929  	m.Tr.CryptoAlg = buf.DecodeUint8()
  1930  	m.Tr.CryptoKeySize = buf.DecodeUint32()
  1931  	m.Tr.IntegAlg = buf.DecodeUint8()
  1932  	m.Tr.DhGroup = buf.DecodeUint8()
  1933  	return nil
  1934  }
  1935  
  1936  // Ikev2SetIkeTransformsReply defines message 'ikev2_set_ike_transforms_reply'.
  1937  // InProgress: the message form may change in the future versions
  1938  type Ikev2SetIkeTransformsReply struct {
  1939  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1940  }
  1941  
  1942  func (m *Ikev2SetIkeTransformsReply) Reset()               { *m = Ikev2SetIkeTransformsReply{} }
  1943  func (*Ikev2SetIkeTransformsReply) GetMessageName() string { return "ikev2_set_ike_transforms_reply" }
  1944  func (*Ikev2SetIkeTransformsReply) GetCrcString() string   { return "e8d4e804" }
  1945  func (*Ikev2SetIkeTransformsReply) GetMessageType() api.MessageType {
  1946  	return api.ReplyMessage
  1947  }
  1948  
  1949  func (m *Ikev2SetIkeTransformsReply) Size() (size int) {
  1950  	if m == nil {
  1951  		return 0
  1952  	}
  1953  	size += 4 // m.Retval
  1954  	return size
  1955  }
  1956  func (m *Ikev2SetIkeTransformsReply) Marshal(b []byte) ([]byte, error) {
  1957  	if b == nil {
  1958  		b = make([]byte, m.Size())
  1959  	}
  1960  	buf := codec.NewBuffer(b)
  1961  	buf.EncodeInt32(m.Retval)
  1962  	return buf.Bytes(), nil
  1963  }
  1964  func (m *Ikev2SetIkeTransformsReply) Unmarshal(b []byte) error {
  1965  	buf := codec.NewBuffer(b)
  1966  	m.Retval = buf.DecodeInt32()
  1967  	return nil
  1968  }
  1969  
  1970  // IKEv2: Set IKEv2 local RSA private key
  1971  //   - key_file - Key file absolute path
  1972  //
  1973  // Ikev2SetLocalKey defines message 'ikev2_set_local_key'.
  1974  // InProgress: the message form may change in the future versions
  1975  type Ikev2SetLocalKey struct {
  1976  	KeyFile string `binapi:"string[256],name=key_file" json:"key_file,omitempty"`
  1977  }
  1978  
  1979  func (m *Ikev2SetLocalKey) Reset()               { *m = Ikev2SetLocalKey{} }
  1980  func (*Ikev2SetLocalKey) GetMessageName() string { return "ikev2_set_local_key" }
  1981  func (*Ikev2SetLocalKey) GetCrcString() string   { return "799b69ec" }
  1982  func (*Ikev2SetLocalKey) GetMessageType() api.MessageType {
  1983  	return api.RequestMessage
  1984  }
  1985  
  1986  func (m *Ikev2SetLocalKey) Size() (size int) {
  1987  	if m == nil {
  1988  		return 0
  1989  	}
  1990  	size += 256 // m.KeyFile
  1991  	return size
  1992  }
  1993  func (m *Ikev2SetLocalKey) Marshal(b []byte) ([]byte, error) {
  1994  	if b == nil {
  1995  		b = make([]byte, m.Size())
  1996  	}
  1997  	buf := codec.NewBuffer(b)
  1998  	buf.EncodeString(m.KeyFile, 256)
  1999  	return buf.Bytes(), nil
  2000  }
  2001  func (m *Ikev2SetLocalKey) Unmarshal(b []byte) error {
  2002  	buf := codec.NewBuffer(b)
  2003  	m.KeyFile = buf.DecodeString(256)
  2004  	return nil
  2005  }
  2006  
  2007  // Ikev2SetLocalKeyReply defines message 'ikev2_set_local_key_reply'.
  2008  // InProgress: the message form may change in the future versions
  2009  type Ikev2SetLocalKeyReply struct {
  2010  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  2011  }
  2012  
  2013  func (m *Ikev2SetLocalKeyReply) Reset()               { *m = Ikev2SetLocalKeyReply{} }
  2014  func (*Ikev2SetLocalKeyReply) GetMessageName() string { return "ikev2_set_local_key_reply" }
  2015  func (*Ikev2SetLocalKeyReply) GetCrcString() string   { return "e8d4e804" }
  2016  func (*Ikev2SetLocalKeyReply) GetMessageType() api.MessageType {
  2017  	return api.ReplyMessage
  2018  }
  2019  
  2020  func (m *Ikev2SetLocalKeyReply) Size() (size int) {
  2021  	if m == nil {
  2022  		return 0
  2023  	}
  2024  	size += 4 // m.Retval
  2025  	return size
  2026  }
  2027  func (m *Ikev2SetLocalKeyReply) Marshal(b []byte) ([]byte, error) {
  2028  	if b == nil {
  2029  		b = make([]byte, m.Size())
  2030  	}
  2031  	buf := codec.NewBuffer(b)
  2032  	buf.EncodeInt32(m.Retval)
  2033  	return buf.Bytes(), nil
  2034  }
  2035  func (m *Ikev2SetLocalKeyReply) Unmarshal(b []byte) error {
  2036  	buf := codec.NewBuffer(b)
  2037  	m.Retval = buf.DecodeInt32()
  2038  	return nil
  2039  }
  2040  
  2041  // IKEv2: Set IKEv2 responder interface and IP address
  2042  //   - name - IKEv2 profile name
  2043  //   - responder - responder data
  2044  //
  2045  // Ikev2SetResponder defines message 'ikev2_set_responder'.
  2046  // InProgress: the message form may change in the future versions
  2047  type Ikev2SetResponder struct {
  2048  	Name      string                     `binapi:"string[64],name=name" json:"name,omitempty"`
  2049  	Responder ikev2_types.Ikev2Responder `binapi:"ikev2_responder,name=responder" json:"responder,omitempty"`
  2050  }
  2051  
  2052  func (m *Ikev2SetResponder) Reset()               { *m = Ikev2SetResponder{} }
  2053  func (*Ikev2SetResponder) GetMessageName() string { return "ikev2_set_responder" }
  2054  func (*Ikev2SetResponder) GetCrcString() string   { return "a2055df1" }
  2055  func (*Ikev2SetResponder) GetMessageType() api.MessageType {
  2056  	return api.RequestMessage
  2057  }
  2058  
  2059  func (m *Ikev2SetResponder) Size() (size int) {
  2060  	if m == nil {
  2061  		return 0
  2062  	}
  2063  	size += 64     // m.Name
  2064  	size += 4      // m.Responder.SwIfIndex
  2065  	size += 1      // m.Responder.Addr.Af
  2066  	size += 1 * 16 // m.Responder.Addr.Un
  2067  	return size
  2068  }
  2069  func (m *Ikev2SetResponder) Marshal(b []byte) ([]byte, error) {
  2070  	if b == nil {
  2071  		b = make([]byte, m.Size())
  2072  	}
  2073  	buf := codec.NewBuffer(b)
  2074  	buf.EncodeString(m.Name, 64)
  2075  	buf.EncodeUint32(uint32(m.Responder.SwIfIndex))
  2076  	buf.EncodeUint8(uint8(m.Responder.Addr.Af))
  2077  	buf.EncodeBytes(m.Responder.Addr.Un.XXX_UnionData[:], 16)
  2078  	return buf.Bytes(), nil
  2079  }
  2080  func (m *Ikev2SetResponder) Unmarshal(b []byte) error {
  2081  	buf := codec.NewBuffer(b)
  2082  	m.Name = buf.DecodeString(64)
  2083  	m.Responder.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
  2084  	m.Responder.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8())
  2085  	copy(m.Responder.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  2086  	return nil
  2087  }
  2088  
  2089  // Ikev2SetResponderHostname defines message 'ikev2_set_responder_hostname'.
  2090  // InProgress: the message form may change in the future versions
  2091  type Ikev2SetResponderHostname struct {
  2092  	Name      string                         `binapi:"string[64],name=name" json:"name,omitempty"`
  2093  	Hostname  string                         `binapi:"string[64],name=hostname" json:"hostname,omitempty"`
  2094  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
  2095  }
  2096  
  2097  func (m *Ikev2SetResponderHostname) Reset()               { *m = Ikev2SetResponderHostname{} }
  2098  func (*Ikev2SetResponderHostname) GetMessageName() string { return "ikev2_set_responder_hostname" }
  2099  func (*Ikev2SetResponderHostname) GetCrcString() string   { return "350d6949" }
  2100  func (*Ikev2SetResponderHostname) GetMessageType() api.MessageType {
  2101  	return api.RequestMessage
  2102  }
  2103  
  2104  func (m *Ikev2SetResponderHostname) Size() (size int) {
  2105  	if m == nil {
  2106  		return 0
  2107  	}
  2108  	size += 64 // m.Name
  2109  	size += 64 // m.Hostname
  2110  	size += 4  // m.SwIfIndex
  2111  	return size
  2112  }
  2113  func (m *Ikev2SetResponderHostname) Marshal(b []byte) ([]byte, error) {
  2114  	if b == nil {
  2115  		b = make([]byte, m.Size())
  2116  	}
  2117  	buf := codec.NewBuffer(b)
  2118  	buf.EncodeString(m.Name, 64)
  2119  	buf.EncodeString(m.Hostname, 64)
  2120  	buf.EncodeUint32(uint32(m.SwIfIndex))
  2121  	return buf.Bytes(), nil
  2122  }
  2123  func (m *Ikev2SetResponderHostname) Unmarshal(b []byte) error {
  2124  	buf := codec.NewBuffer(b)
  2125  	m.Name = buf.DecodeString(64)
  2126  	m.Hostname = buf.DecodeString(64)
  2127  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
  2128  	return nil
  2129  }
  2130  
  2131  // Ikev2SetResponderHostnameReply defines message 'ikev2_set_responder_hostname_reply'.
  2132  // InProgress: the message form may change in the future versions
  2133  type Ikev2SetResponderHostnameReply struct {
  2134  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  2135  }
  2136  
  2137  func (m *Ikev2SetResponderHostnameReply) Reset() { *m = Ikev2SetResponderHostnameReply{} }
  2138  func (*Ikev2SetResponderHostnameReply) GetMessageName() string {
  2139  	return "ikev2_set_responder_hostname_reply"
  2140  }
  2141  func (*Ikev2SetResponderHostnameReply) GetCrcString() string { return "e8d4e804" }
  2142  func (*Ikev2SetResponderHostnameReply) GetMessageType() api.MessageType {
  2143  	return api.ReplyMessage
  2144  }
  2145  
  2146  func (m *Ikev2SetResponderHostnameReply) Size() (size int) {
  2147  	if m == nil {
  2148  		return 0
  2149  	}
  2150  	size += 4 // m.Retval
  2151  	return size
  2152  }
  2153  func (m *Ikev2SetResponderHostnameReply) Marshal(b []byte) ([]byte, error) {
  2154  	if b == nil {
  2155  		b = make([]byte, m.Size())
  2156  	}
  2157  	buf := codec.NewBuffer(b)
  2158  	buf.EncodeInt32(m.Retval)
  2159  	return buf.Bytes(), nil
  2160  }
  2161  func (m *Ikev2SetResponderHostnameReply) Unmarshal(b []byte) error {
  2162  	buf := codec.NewBuffer(b)
  2163  	m.Retval = buf.DecodeInt32()
  2164  	return nil
  2165  }
  2166  
  2167  // Ikev2SetResponderReply defines message 'ikev2_set_responder_reply'.
  2168  // InProgress: the message form may change in the future versions
  2169  type Ikev2SetResponderReply struct {
  2170  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  2171  }
  2172  
  2173  func (m *Ikev2SetResponderReply) Reset()               { *m = Ikev2SetResponderReply{} }
  2174  func (*Ikev2SetResponderReply) GetMessageName() string { return "ikev2_set_responder_reply" }
  2175  func (*Ikev2SetResponderReply) GetCrcString() string   { return "e8d4e804" }
  2176  func (*Ikev2SetResponderReply) GetMessageType() api.MessageType {
  2177  	return api.ReplyMessage
  2178  }
  2179  
  2180  func (m *Ikev2SetResponderReply) Size() (size int) {
  2181  	if m == nil {
  2182  		return 0
  2183  	}
  2184  	size += 4 // m.Retval
  2185  	return size
  2186  }
  2187  func (m *Ikev2SetResponderReply) Marshal(b []byte) ([]byte, error) {
  2188  	if b == nil {
  2189  		b = make([]byte, m.Size())
  2190  	}
  2191  	buf := codec.NewBuffer(b)
  2192  	buf.EncodeInt32(m.Retval)
  2193  	return buf.Bytes(), nil
  2194  }
  2195  func (m *Ikev2SetResponderReply) Unmarshal(b []byte) error {
  2196  	buf := codec.NewBuffer(b)
  2197  	m.Retval = buf.DecodeInt32()
  2198  	return nil
  2199  }
  2200  
  2201  // IKEv2: Set Child SA lifetime, limited by time and/or data
  2202  //   - name - IKEv2 profile name
  2203  //   - lifetime - SA maximum life time in seconds (0 to disable)
  2204  //   - lifetime_jitter - Jitter added to prevent simultaneous rekeying
  2205  //   - handover - Hand over time
  2206  //   - lifetime_maxdata - SA maximum life time in bytes (0 to disable)
  2207  //
  2208  // Ikev2SetSaLifetime defines message 'ikev2_set_sa_lifetime'.
  2209  // InProgress: the message form may change in the future versions
  2210  type Ikev2SetSaLifetime struct {
  2211  	Name            string `binapi:"string[64],name=name" json:"name,omitempty"`
  2212  	Lifetime        uint64 `binapi:"u64,name=lifetime" json:"lifetime,omitempty"`
  2213  	LifetimeJitter  uint32 `binapi:"u32,name=lifetime_jitter" json:"lifetime_jitter,omitempty"`
  2214  	Handover        uint32 `binapi:"u32,name=handover" json:"handover,omitempty"`
  2215  	LifetimeMaxdata uint64 `binapi:"u64,name=lifetime_maxdata" json:"lifetime_maxdata,omitempty"`
  2216  }
  2217  
  2218  func (m *Ikev2SetSaLifetime) Reset()               { *m = Ikev2SetSaLifetime{} }
  2219  func (*Ikev2SetSaLifetime) GetMessageName() string { return "ikev2_set_sa_lifetime" }
  2220  func (*Ikev2SetSaLifetime) GetCrcString() string   { return "7039feaa" }
  2221  func (*Ikev2SetSaLifetime) GetMessageType() api.MessageType {
  2222  	return api.RequestMessage
  2223  }
  2224  
  2225  func (m *Ikev2SetSaLifetime) Size() (size int) {
  2226  	if m == nil {
  2227  		return 0
  2228  	}
  2229  	size += 64 // m.Name
  2230  	size += 8  // m.Lifetime
  2231  	size += 4  // m.LifetimeJitter
  2232  	size += 4  // m.Handover
  2233  	size += 8  // m.LifetimeMaxdata
  2234  	return size
  2235  }
  2236  func (m *Ikev2SetSaLifetime) Marshal(b []byte) ([]byte, error) {
  2237  	if b == nil {
  2238  		b = make([]byte, m.Size())
  2239  	}
  2240  	buf := codec.NewBuffer(b)
  2241  	buf.EncodeString(m.Name, 64)
  2242  	buf.EncodeUint64(m.Lifetime)
  2243  	buf.EncodeUint32(m.LifetimeJitter)
  2244  	buf.EncodeUint32(m.Handover)
  2245  	buf.EncodeUint64(m.LifetimeMaxdata)
  2246  	return buf.Bytes(), nil
  2247  }
  2248  func (m *Ikev2SetSaLifetime) Unmarshal(b []byte) error {
  2249  	buf := codec.NewBuffer(b)
  2250  	m.Name = buf.DecodeString(64)
  2251  	m.Lifetime = buf.DecodeUint64()
  2252  	m.LifetimeJitter = buf.DecodeUint32()
  2253  	m.Handover = buf.DecodeUint32()
  2254  	m.LifetimeMaxdata = buf.DecodeUint64()
  2255  	return nil
  2256  }
  2257  
  2258  // Ikev2SetSaLifetimeReply defines message 'ikev2_set_sa_lifetime_reply'.
  2259  // InProgress: the message form may change in the future versions
  2260  type Ikev2SetSaLifetimeReply struct {
  2261  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  2262  }
  2263  
  2264  func (m *Ikev2SetSaLifetimeReply) Reset()               { *m = Ikev2SetSaLifetimeReply{} }
  2265  func (*Ikev2SetSaLifetimeReply) GetMessageName() string { return "ikev2_set_sa_lifetime_reply" }
  2266  func (*Ikev2SetSaLifetimeReply) GetCrcString() string   { return "e8d4e804" }
  2267  func (*Ikev2SetSaLifetimeReply) GetMessageType() api.MessageType {
  2268  	return api.ReplyMessage
  2269  }
  2270  
  2271  func (m *Ikev2SetSaLifetimeReply) Size() (size int) {
  2272  	if m == nil {
  2273  		return 0
  2274  	}
  2275  	size += 4 // m.Retval
  2276  	return size
  2277  }
  2278  func (m *Ikev2SetSaLifetimeReply) Marshal(b []byte) ([]byte, error) {
  2279  	if b == nil {
  2280  		b = make([]byte, m.Size())
  2281  	}
  2282  	buf := codec.NewBuffer(b)
  2283  	buf.EncodeInt32(m.Retval)
  2284  	return buf.Bytes(), nil
  2285  }
  2286  func (m *Ikev2SetSaLifetimeReply) Unmarshal(b []byte) error {
  2287  	buf := codec.NewBuffer(b)
  2288  	m.Retval = buf.DecodeInt32()
  2289  	return nil
  2290  }
  2291  
  2292  // IKEv2: Set the tunnel interface which will be protected by IKE
  2293  //
  2294  //	If this API is not called, a new tunnel will be created
  2295  //	- name - IKEv2 profile name
  2296  //	- sw_if_index - Of an existing tunnel
  2297  //
  2298  // Ikev2SetTunnelInterface defines message 'ikev2_set_tunnel_interface'.
  2299  // InProgress: the message form may change in the future versions
  2300  type Ikev2SetTunnelInterface struct {
  2301  	Name      string                         `binapi:"string[64],name=name" json:"name,omitempty"`
  2302  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
  2303  }
  2304  
  2305  func (m *Ikev2SetTunnelInterface) Reset()               { *m = Ikev2SetTunnelInterface{} }
  2306  func (*Ikev2SetTunnelInterface) GetMessageName() string { return "ikev2_set_tunnel_interface" }
  2307  func (*Ikev2SetTunnelInterface) GetCrcString() string   { return "ca67182c" }
  2308  func (*Ikev2SetTunnelInterface) GetMessageType() api.MessageType {
  2309  	return api.RequestMessage
  2310  }
  2311  
  2312  func (m *Ikev2SetTunnelInterface) Size() (size int) {
  2313  	if m == nil {
  2314  		return 0
  2315  	}
  2316  	size += 64 // m.Name
  2317  	size += 4  // m.SwIfIndex
  2318  	return size
  2319  }
  2320  func (m *Ikev2SetTunnelInterface) Marshal(b []byte) ([]byte, error) {
  2321  	if b == nil {
  2322  		b = make([]byte, m.Size())
  2323  	}
  2324  	buf := codec.NewBuffer(b)
  2325  	buf.EncodeString(m.Name, 64)
  2326  	buf.EncodeUint32(uint32(m.SwIfIndex))
  2327  	return buf.Bytes(), nil
  2328  }
  2329  func (m *Ikev2SetTunnelInterface) Unmarshal(b []byte) error {
  2330  	buf := codec.NewBuffer(b)
  2331  	m.Name = buf.DecodeString(64)
  2332  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
  2333  	return nil
  2334  }
  2335  
  2336  // Ikev2SetTunnelInterfaceReply defines message 'ikev2_set_tunnel_interface_reply'.
  2337  // InProgress: the message form may change in the future versions
  2338  type Ikev2SetTunnelInterfaceReply struct {
  2339  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  2340  }
  2341  
  2342  func (m *Ikev2SetTunnelInterfaceReply) Reset() { *m = Ikev2SetTunnelInterfaceReply{} }
  2343  func (*Ikev2SetTunnelInterfaceReply) GetMessageName() string {
  2344  	return "ikev2_set_tunnel_interface_reply"
  2345  }
  2346  func (*Ikev2SetTunnelInterfaceReply) GetCrcString() string { return "e8d4e804" }
  2347  func (*Ikev2SetTunnelInterfaceReply) GetMessageType() api.MessageType {
  2348  	return api.ReplyMessage
  2349  }
  2350  
  2351  func (m *Ikev2SetTunnelInterfaceReply) Size() (size int) {
  2352  	if m == nil {
  2353  		return 0
  2354  	}
  2355  	size += 4 // m.Retval
  2356  	return size
  2357  }
  2358  func (m *Ikev2SetTunnelInterfaceReply) Marshal(b []byte) ([]byte, error) {
  2359  	if b == nil {
  2360  		b = make([]byte, m.Size())
  2361  	}
  2362  	buf := codec.NewBuffer(b)
  2363  	buf.EncodeInt32(m.Retval)
  2364  	return buf.Bytes(), nil
  2365  }
  2366  func (m *Ikev2SetTunnelInterfaceReply) Unmarshal(b []byte) error {
  2367  	buf := codec.NewBuffer(b)
  2368  	m.Retval = buf.DecodeInt32()
  2369  	return nil
  2370  }
  2371  
  2372  // details on specific traffic selector
  2373  //   - retval - return code
  2374  //   - ts - traffic selector data
  2375  //
  2376  // Ikev2TrafficSelectorDetails defines message 'ikev2_traffic_selector_details'.
  2377  // InProgress: the message form may change in the future versions
  2378  type Ikev2TrafficSelectorDetails struct {
  2379  	Retval int32               `binapi:"i32,name=retval" json:"retval,omitempty"`
  2380  	Ts     ikev2_types.Ikev2Ts `binapi:"ikev2_ts,name=ts" json:"ts,omitempty"`
  2381  }
  2382  
  2383  func (m *Ikev2TrafficSelectorDetails) Reset()               { *m = Ikev2TrafficSelectorDetails{} }
  2384  func (*Ikev2TrafficSelectorDetails) GetMessageName() string { return "ikev2_traffic_selector_details" }
  2385  func (*Ikev2TrafficSelectorDetails) GetCrcString() string   { return "518cb06f" }
  2386  func (*Ikev2TrafficSelectorDetails) GetMessageType() api.MessageType {
  2387  	return api.ReplyMessage
  2388  }
  2389  
  2390  func (m *Ikev2TrafficSelectorDetails) Size() (size int) {
  2391  	if m == nil {
  2392  		return 0
  2393  	}
  2394  	size += 4      // m.Retval
  2395  	size += 4      // m.Ts.SaIndex
  2396  	size += 4      // m.Ts.ChildSaIndex
  2397  	size += 1      // m.Ts.IsLocal
  2398  	size += 1      // m.Ts.ProtocolID
  2399  	size += 2      // m.Ts.StartPort
  2400  	size += 2      // m.Ts.EndPort
  2401  	size += 1      // m.Ts.StartAddr.Af
  2402  	size += 1 * 16 // m.Ts.StartAddr.Un
  2403  	size += 1      // m.Ts.EndAddr.Af
  2404  	size += 1 * 16 // m.Ts.EndAddr.Un
  2405  	return size
  2406  }
  2407  func (m *Ikev2TrafficSelectorDetails) Marshal(b []byte) ([]byte, error) {
  2408  	if b == nil {
  2409  		b = make([]byte, m.Size())
  2410  	}
  2411  	buf := codec.NewBuffer(b)
  2412  	buf.EncodeInt32(m.Retval)
  2413  	buf.EncodeUint32(m.Ts.SaIndex)
  2414  	buf.EncodeUint32(m.Ts.ChildSaIndex)
  2415  	buf.EncodeBool(m.Ts.IsLocal)
  2416  	buf.EncodeUint8(m.Ts.ProtocolID)
  2417  	buf.EncodeUint16(m.Ts.StartPort)
  2418  	buf.EncodeUint16(m.Ts.EndPort)
  2419  	buf.EncodeUint8(uint8(m.Ts.StartAddr.Af))
  2420  	buf.EncodeBytes(m.Ts.StartAddr.Un.XXX_UnionData[:], 16)
  2421  	buf.EncodeUint8(uint8(m.Ts.EndAddr.Af))
  2422  	buf.EncodeBytes(m.Ts.EndAddr.Un.XXX_UnionData[:], 16)
  2423  	return buf.Bytes(), nil
  2424  }
  2425  func (m *Ikev2TrafficSelectorDetails) Unmarshal(b []byte) error {
  2426  	buf := codec.NewBuffer(b)
  2427  	m.Retval = buf.DecodeInt32()
  2428  	m.Ts.SaIndex = buf.DecodeUint32()
  2429  	m.Ts.ChildSaIndex = buf.DecodeUint32()
  2430  	m.Ts.IsLocal = buf.DecodeBool()
  2431  	m.Ts.ProtocolID = buf.DecodeUint8()
  2432  	m.Ts.StartPort = buf.DecodeUint16()
  2433  	m.Ts.EndPort = buf.DecodeUint16()
  2434  	m.Ts.StartAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
  2435  	copy(m.Ts.StartAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  2436  	m.Ts.EndAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
  2437  	copy(m.Ts.EndAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  2438  	return nil
  2439  }
  2440  
  2441  // dump traffic selectors
  2442  //   - is_initiator - specify type initiator|responder of nonce
  2443  //   - sa_index - index of specific sa
  2444  //   - child_sa_index - index of specific sa child of specific sa
  2445  //
  2446  // Ikev2TrafficSelectorDump defines message 'ikev2_traffic_selector_dump'.
  2447  // InProgress: the message form may change in the future versions
  2448  type Ikev2TrafficSelectorDump struct {
  2449  	IsInitiator  bool   `binapi:"bool,name=is_initiator" json:"is_initiator,omitempty"`
  2450  	SaIndex      uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"`
  2451  	ChildSaIndex uint32 `binapi:"u32,name=child_sa_index" json:"child_sa_index,omitempty"`
  2452  }
  2453  
  2454  func (m *Ikev2TrafficSelectorDump) Reset()               { *m = Ikev2TrafficSelectorDump{} }
  2455  func (*Ikev2TrafficSelectorDump) GetMessageName() string { return "ikev2_traffic_selector_dump" }
  2456  func (*Ikev2TrafficSelectorDump) GetCrcString() string   { return "a7385e33" }
  2457  func (*Ikev2TrafficSelectorDump) GetMessageType() api.MessageType {
  2458  	return api.RequestMessage
  2459  }
  2460  
  2461  func (m *Ikev2TrafficSelectorDump) Size() (size int) {
  2462  	if m == nil {
  2463  		return 0
  2464  	}
  2465  	size += 1 // m.IsInitiator
  2466  	size += 4 // m.SaIndex
  2467  	size += 4 // m.ChildSaIndex
  2468  	return size
  2469  }
  2470  func (m *Ikev2TrafficSelectorDump) Marshal(b []byte) ([]byte, error) {
  2471  	if b == nil {
  2472  		b = make([]byte, m.Size())
  2473  	}
  2474  	buf := codec.NewBuffer(b)
  2475  	buf.EncodeBool(m.IsInitiator)
  2476  	buf.EncodeUint32(m.SaIndex)
  2477  	buf.EncodeUint32(m.ChildSaIndex)
  2478  	return buf.Bytes(), nil
  2479  }
  2480  func (m *Ikev2TrafficSelectorDump) Unmarshal(b []byte) error {
  2481  	buf := codec.NewBuffer(b)
  2482  	m.IsInitiator = buf.DecodeBool()
  2483  	m.SaIndex = buf.DecodeUint32()
  2484  	m.ChildSaIndex = buf.DecodeUint32()
  2485  	return nil
  2486  }
  2487  
  2488  func init() { file_ikev2_binapi_init() }
  2489  func file_ikev2_binapi_init() {
  2490  	api.RegisterMessage((*Ikev2ChildSaDetails)(nil), "ikev2_child_sa_details_ff67741f")
  2491  	api.RegisterMessage((*Ikev2ChildSaDump)(nil), "ikev2_child_sa_dump_01eab609")
  2492  	api.RegisterMessage((*Ikev2InitiateDelChildSa)(nil), "ikev2_initiate_del_child_sa_7f004d2e")
  2493  	api.RegisterMessage((*Ikev2InitiateDelChildSaReply)(nil), "ikev2_initiate_del_child_sa_reply_e8d4e804")
  2494  	api.RegisterMessage((*Ikev2InitiateDelIkeSa)(nil), "ikev2_initiate_del_ike_sa_8d125bdd")
  2495  	api.RegisterMessage((*Ikev2InitiateDelIkeSaReply)(nil), "ikev2_initiate_del_ike_sa_reply_e8d4e804")
  2496  	api.RegisterMessage((*Ikev2InitiateRekeyChildSa)(nil), "ikev2_initiate_rekey_child_sa_7f004d2e")
  2497  	api.RegisterMessage((*Ikev2InitiateRekeyChildSaReply)(nil), "ikev2_initiate_rekey_child_sa_reply_e8d4e804")
  2498  	api.RegisterMessage((*Ikev2InitiateSaInit)(nil), "ikev2_initiate_sa_init_ebf79a66")
  2499  	api.RegisterMessage((*Ikev2InitiateSaInitReply)(nil), "ikev2_initiate_sa_init_reply_e8d4e804")
  2500  	api.RegisterMessage((*Ikev2NonceGet)(nil), "ikev2_nonce_get_7fe9ad51")
  2501  	api.RegisterMessage((*Ikev2NonceGetReply)(nil), "ikev2_nonce_get_reply_1b37a342")
  2502  	api.RegisterMessage((*Ikev2PluginGetVersion)(nil), "ikev2_plugin_get_version_51077d14")
  2503  	api.RegisterMessage((*Ikev2PluginGetVersionReply)(nil), "ikev2_plugin_get_version_reply_9b32cf86")
  2504  	api.RegisterMessage((*Ikev2ProfileAddDel)(nil), "ikev2_profile_add_del_2c925b55")
  2505  	api.RegisterMessage((*Ikev2ProfileAddDelReply)(nil), "ikev2_profile_add_del_reply_e8d4e804")
  2506  	api.RegisterMessage((*Ikev2ProfileDetails)(nil), "ikev2_profile_details_670d01d9")
  2507  	api.RegisterMessage((*Ikev2ProfileDisableNatt)(nil), "ikev2_profile_disable_natt_ebf79a66")
  2508  	api.RegisterMessage((*Ikev2ProfileDisableNattReply)(nil), "ikev2_profile_disable_natt_reply_e8d4e804")
  2509  	api.RegisterMessage((*Ikev2ProfileDump)(nil), "ikev2_profile_dump_51077d14")
  2510  	api.RegisterMessage((*Ikev2ProfileSetAuth)(nil), "ikev2_profile_set_auth_642c97cd")
  2511  	api.RegisterMessage((*Ikev2ProfileSetAuthReply)(nil), "ikev2_profile_set_auth_reply_e8d4e804")
  2512  	api.RegisterMessage((*Ikev2ProfileSetID)(nil), "ikev2_profile_set_id_4d7e2418")
  2513  	api.RegisterMessage((*Ikev2ProfileSetIDReply)(nil), "ikev2_profile_set_id_reply_e8d4e804")
  2514  	api.RegisterMessage((*Ikev2ProfileSetIpsecUDPPort)(nil), "ikev2_profile_set_ipsec_udp_port_615ce758")
  2515  	api.RegisterMessage((*Ikev2ProfileSetIpsecUDPPortReply)(nil), "ikev2_profile_set_ipsec_udp_port_reply_e8d4e804")
  2516  	api.RegisterMessage((*Ikev2ProfileSetLiveness)(nil), "ikev2_profile_set_liveness_6bdf4d65")
  2517  	api.RegisterMessage((*Ikev2ProfileSetLivenessReply)(nil), "ikev2_profile_set_liveness_reply_e8d4e804")
  2518  	api.RegisterMessage((*Ikev2ProfileSetTs)(nil), "ikev2_profile_set_ts_8eb8cfd1")
  2519  	api.RegisterMessage((*Ikev2ProfileSetTsReply)(nil), "ikev2_profile_set_ts_reply_e8d4e804")
  2520  	api.RegisterMessage((*Ikev2ProfileSetUDPEncap)(nil), "ikev2_profile_set_udp_encap_ebf79a66")
  2521  	api.RegisterMessage((*Ikev2ProfileSetUDPEncapReply)(nil), "ikev2_profile_set_udp_encap_reply_e8d4e804")
  2522  	api.RegisterMessage((*Ikev2SaDetails)(nil), "ikev2_sa_details_937c22d5")
  2523  	api.RegisterMessage((*Ikev2SaDump)(nil), "ikev2_sa_dump_51077d14")
  2524  	api.RegisterMessage((*Ikev2SetEspTransforms)(nil), "ikev2_set_esp_transforms_a63dc205")
  2525  	api.RegisterMessage((*Ikev2SetEspTransformsReply)(nil), "ikev2_set_esp_transforms_reply_e8d4e804")
  2526  	api.RegisterMessage((*Ikev2SetIkeTransforms)(nil), "ikev2_set_ike_transforms_076d7378")
  2527  	api.RegisterMessage((*Ikev2SetIkeTransformsReply)(nil), "ikev2_set_ike_transforms_reply_e8d4e804")
  2528  	api.RegisterMessage((*Ikev2SetLocalKey)(nil), "ikev2_set_local_key_799b69ec")
  2529  	api.RegisterMessage((*Ikev2SetLocalKeyReply)(nil), "ikev2_set_local_key_reply_e8d4e804")
  2530  	api.RegisterMessage((*Ikev2SetResponder)(nil), "ikev2_set_responder_a2055df1")
  2531  	api.RegisterMessage((*Ikev2SetResponderHostname)(nil), "ikev2_set_responder_hostname_350d6949")
  2532  	api.RegisterMessage((*Ikev2SetResponderHostnameReply)(nil), "ikev2_set_responder_hostname_reply_e8d4e804")
  2533  	api.RegisterMessage((*Ikev2SetResponderReply)(nil), "ikev2_set_responder_reply_e8d4e804")
  2534  	api.RegisterMessage((*Ikev2SetSaLifetime)(nil), "ikev2_set_sa_lifetime_7039feaa")
  2535  	api.RegisterMessage((*Ikev2SetSaLifetimeReply)(nil), "ikev2_set_sa_lifetime_reply_e8d4e804")
  2536  	api.RegisterMessage((*Ikev2SetTunnelInterface)(nil), "ikev2_set_tunnel_interface_ca67182c")
  2537  	api.RegisterMessage((*Ikev2SetTunnelInterfaceReply)(nil), "ikev2_set_tunnel_interface_reply_e8d4e804")
  2538  	api.RegisterMessage((*Ikev2TrafficSelectorDetails)(nil), "ikev2_traffic_selector_details_518cb06f")
  2539  	api.RegisterMessage((*Ikev2TrafficSelectorDump)(nil), "ikev2_traffic_selector_dump_a7385e33")
  2540  }
  2541  
  2542  // Messages returns list of all messages in this module.
  2543  func AllMessages() []api.Message {
  2544  	return []api.Message{
  2545  		(*Ikev2ChildSaDetails)(nil),
  2546  		(*Ikev2ChildSaDump)(nil),
  2547  		(*Ikev2InitiateDelChildSa)(nil),
  2548  		(*Ikev2InitiateDelChildSaReply)(nil),
  2549  		(*Ikev2InitiateDelIkeSa)(nil),
  2550  		(*Ikev2InitiateDelIkeSaReply)(nil),
  2551  		(*Ikev2InitiateRekeyChildSa)(nil),
  2552  		(*Ikev2InitiateRekeyChildSaReply)(nil),
  2553  		(*Ikev2InitiateSaInit)(nil),
  2554  		(*Ikev2InitiateSaInitReply)(nil),
  2555  		(*Ikev2NonceGet)(nil),
  2556  		(*Ikev2NonceGetReply)(nil),
  2557  		(*Ikev2PluginGetVersion)(nil),
  2558  		(*Ikev2PluginGetVersionReply)(nil),
  2559  		(*Ikev2ProfileAddDel)(nil),
  2560  		(*Ikev2ProfileAddDelReply)(nil),
  2561  		(*Ikev2ProfileDetails)(nil),
  2562  		(*Ikev2ProfileDisableNatt)(nil),
  2563  		(*Ikev2ProfileDisableNattReply)(nil),
  2564  		(*Ikev2ProfileDump)(nil),
  2565  		(*Ikev2ProfileSetAuth)(nil),
  2566  		(*Ikev2ProfileSetAuthReply)(nil),
  2567  		(*Ikev2ProfileSetID)(nil),
  2568  		(*Ikev2ProfileSetIDReply)(nil),
  2569  		(*Ikev2ProfileSetIpsecUDPPort)(nil),
  2570  		(*Ikev2ProfileSetIpsecUDPPortReply)(nil),
  2571  		(*Ikev2ProfileSetLiveness)(nil),
  2572  		(*Ikev2ProfileSetLivenessReply)(nil),
  2573  		(*Ikev2ProfileSetTs)(nil),
  2574  		(*Ikev2ProfileSetTsReply)(nil),
  2575  		(*Ikev2ProfileSetUDPEncap)(nil),
  2576  		(*Ikev2ProfileSetUDPEncapReply)(nil),
  2577  		(*Ikev2SaDetails)(nil),
  2578  		(*Ikev2SaDump)(nil),
  2579  		(*Ikev2SetEspTransforms)(nil),
  2580  		(*Ikev2SetEspTransformsReply)(nil),
  2581  		(*Ikev2SetIkeTransforms)(nil),
  2582  		(*Ikev2SetIkeTransformsReply)(nil),
  2583  		(*Ikev2SetLocalKey)(nil),
  2584  		(*Ikev2SetLocalKeyReply)(nil),
  2585  		(*Ikev2SetResponder)(nil),
  2586  		(*Ikev2SetResponderHostname)(nil),
  2587  		(*Ikev2SetResponderHostnameReply)(nil),
  2588  		(*Ikev2SetResponderReply)(nil),
  2589  		(*Ikev2SetSaLifetime)(nil),
  2590  		(*Ikev2SetSaLifetimeReply)(nil),
  2591  		(*Ikev2SetTunnelInterface)(nil),
  2592  		(*Ikev2SetTunnelInterfaceReply)(nil),
  2593  		(*Ikev2TrafficSelectorDetails)(nil),
  2594  		(*Ikev2TrafficSelectorDump)(nil),
  2595  	}
  2596  }