@@ -20,6 +20,8 @@ const (
20
20
ControlTypeManageDsaIT = "2.16.840.1.113730.3.4.2"
21
21
// ControlTypeWhoAmI - https://tools.ietf.org/html/rfc4532
22
22
ControlTypeWhoAmI = "1.3.6.1.4.1.4203.1.11.3"
23
+ // ControlTypeSubTreeDelete - https://datatracker.ietf.org/doc/html/draft-armijo-ldap-treedelete-02
24
+ ControlTypeSubtreeDelete = "1.2.840.113556.1.4.805"
23
25
24
26
// ControlTypeMicrosoftNotification - https://msdn.microsoft.com/en-us/library/aa366983(v=vs.85).aspx
25
27
ControlTypeMicrosoftNotification = "1.2.840.113556.1.4.528"
@@ -34,6 +36,7 @@ var ControlTypeMap = map[string]string{
34
36
ControlTypePaging : "Paging" ,
35
37
ControlTypeBeheraPasswordPolicy : "Password Policy - Behera Draft" ,
36
38
ControlTypeManageDsaIT : "Manage DSA IT" ,
39
+ ControlTypeSubtreeDelete : "Subtree Delete Control" ,
37
40
ControlTypeMicrosoftNotification : "Change Notification - Microsoft" ,
38
41
ControlTypeMicrosoftShowDeleted : "Show Deleted Objects - Microsoft" ,
39
42
ControlTypeMicrosoftServerLinkTTL : "Return TTL-DNs for link values with associated expiry times - Microsoft" ,
@@ -485,6 +488,8 @@ func DecodeControl(packet *ber.Packet) (Control, error) {
485
488
return NewControlMicrosoftShowDeleted (), nil
486
489
case ControlTypeMicrosoftServerLinkTTL :
487
490
return NewControlMicrosoftServerLinkTTL (), nil
491
+ case ControlTypeSubtreeDelete :
492
+ return NewControlSubtreeDelete (), nil
488
493
default :
489
494
c := new (ControlString )
490
495
c .ControlType = ControlType
@@ -519,6 +524,30 @@ func NewControlBeheraPasswordPolicy() *ControlBeheraPasswordPolicy {
519
524
}
520
525
}
521
526
527
+ type ControlSubtreeDelete struct {}
528
+
529
+ func (c * ControlSubtreeDelete ) GetControlType () string {
530
+ return ControlTypeSubtreeDelete
531
+ }
532
+
533
+ func NewControlSubtreeDelete () * ControlSubtreeDelete {
534
+ return & ControlSubtreeDelete {}
535
+ }
536
+
537
+ func (c * ControlSubtreeDelete ) Encode () * ber.Packet {
538
+ packet := ber .Encode (ber .ClassUniversal , ber .TypeConstructed , ber .TagSequence , nil , "Control" )
539
+ packet .AppendChild (ber .NewString (ber .ClassUniversal , ber .TypePrimitive , ber .TagOctetString , ControlTypeSubtreeDelete , "Control Type (" + ControlTypeMap [ControlTypeSubtreeDelete ]+ ")" ))
540
+
541
+ return packet
542
+ }
543
+
544
+ func (c * ControlSubtreeDelete ) String () string {
545
+ return fmt .Sprintf (
546
+ "Control Type: %s (%q)" ,
547
+ ControlTypeMap [ControlTypeSubtreeDelete ],
548
+ ControlTypeSubtreeDelete )
549
+ }
550
+
522
551
func encodeControls (controls []Control ) * ber.Packet {
523
552
packet := ber .Encode (ber .ClassContext , ber .TypeConstructed , 0 , nil , "Controls" )
524
553
for _ , control := range controls {
0 commit comments