1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
//
// DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsISocketTransport.idl
//


/// `interface nsISocketTransport : nsITransport`
///

/// ```text
/// /**
///  * nsISocketTransport
///  *
///  * NOTE: Connection setup is triggered by opening an input or output stream,
///  * it does not start on its own. Completion of the connection setup is
///  * indicated by a STATUS_CONNECTED_TO notification to the event sink (if set).
///  *
///  * NOTE: This is a free-threaded interface, meaning that the methods on
///  * this interface may be called from any thread.
///  */
/// ```
///

// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.

#[repr(C)]
pub struct nsISocketTransport {
    vtable: *const nsISocketTransportVTable,

    /// This field is a phantomdata to ensure that the VTable type and any
    /// struct containing it is not safe to send across threads, as XPCOM is
    /// generally not threadsafe.
    ///
    /// XPCOM interfaces in general are not safe to send across threads.
    __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
}

// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsISocketTransport.
unsafe impl XpCom for nsISocketTransport {
    const IID: nsIID = nsID(0x79221831, 0x85e2, 0x43a8,
        [0x81, 0x52, 0x05, 0xd7, 0x7d, 0x6f, 0xde, 0x31]);
}

// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsISocketTransport {
    #[inline]
    unsafe fn addref(&self) {
        self.AddRef();
    }
    #[inline]
    unsafe fn release(&self) {
        self.Release();
    }
}

// This trait is implemented on all types which can be coerced to from nsISocketTransport.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsISocketTransportCoerce {
    /// Cheaply cast a value of this type from a `nsISocketTransport`.
    fn coerce_from(v: &nsISocketTransport) -> &Self;
}

// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsISocketTransportCoerce for nsISocketTransport {
    #[inline]
    fn coerce_from(v: &nsISocketTransport) -> &Self {
        v
    }
}

impl nsISocketTransport {
    /// Cast this `nsISocketTransport` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsISocketTransportCoerce>(&self) -> &T {
        T::coerce_from(self)
    }
}

// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsISocketTransport {
    type Target = nsITransport;
    #[inline]
    fn deref(&self) -> &nsITransport {
        unsafe {
            ::std::mem::transmute(self)
        }
    }
}

// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsITransportCoerce> nsISocketTransportCoerce for T {
    #[inline]
    fn coerce_from(v: &nsISocketTransport) -> &Self {
        T::coerce_from(v)
    }
}

// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsISocketTransport
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsISocketTransportVTable {
    /// We need to include the members from the base interface's vtable at the start
    /// of the VTable definition.
    pub __base: nsITransportVTable,

    /* readonly attribute AUTF8String host; */
    pub GetHost: unsafe extern "system" fn (this: *const nsISocketTransport, aHost: &mut ::nsstring::nsACString) -> nsresult,

    /* readonly attribute long port; */
    pub GetPort: unsafe extern "system" fn (this: *const nsISocketTransport, aPort: *mut libc::int32_t) -> nsresult,

    /* [binaryname(ScriptableOriginAttributes),implicit_jscontext] attribute jsval originAttributes; */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub GetScriptableOriginAttributes: *const ::libc::c_void,

    /* [binaryname(ScriptableOriginAttributes),implicit_jscontext] attribute jsval originAttributes; */
    /// Unable to generate binding because `native type JS::Value is unsupported`
    pub SetScriptableOriginAttributes: *const ::libc::c_void,

    /* [binaryname(GetOriginAttributes),noscript,nostdcall] OriginAttributes binaryGetOriginAttributes (); */
    /// Unable to generate binding because `nostdcall is unsupported`
    pub GetOriginAttributes: *const ::libc::c_void,

    /* [binaryname(SetOriginAttributes),noscript,nostdcall] void binarySetOriginAttributes (in const_OriginAttributesRef aOriginAttrs); */
    /// Unable to generate binding because `native type const mozilla::OriginAttributes is unsupported`
    pub SetOriginAttributes: *const ::libc::c_void,

    /* attribute ACString networkInterfaceId; */
    pub GetNetworkInterfaceId: unsafe extern "system" fn (this: *const nsISocketTransport, aNetworkInterfaceId: &mut ::nsstring::nsACString) -> nsresult,

    /* attribute ACString networkInterfaceId; */
    pub SetNetworkInterfaceId: unsafe extern "system" fn (this: *const nsISocketTransport, aNetworkInterfaceId: &::nsstring::nsACString) -> nsresult,

    /* [noscript] NetAddr getPeerAddr (); */
    /// Unable to generate binding because `native type mozilla::net::NetAddr is unsupported`
    pub GetPeerAddr: *const ::libc::c_void,

    /* [noscript] NetAddr getSelfAddr (); */
    /// Unable to generate binding because `native type mozilla::net::NetAddr is unsupported`
    pub GetSelfAddr: *const ::libc::c_void,

    /* [noscript] void bind (in NetAddrPtr aLocalAddr); */
    /// Unable to generate binding because `native type mozilla::net::NetAddr is unsupported`
    pub Bind: *const ::libc::c_void,

    /* nsINetAddr getScriptablePeerAddr (); */
    pub GetScriptablePeerAddr: unsafe extern "system" fn (this: *const nsISocketTransport, _retval: *mut *const nsINetAddr) -> nsresult,

    /* nsINetAddr getScriptableSelfAddr (); */
    pub GetScriptableSelfAddr: unsafe extern "system" fn (this: *const nsISocketTransport, _retval: *mut *const nsINetAddr) -> nsresult,

    /* readonly attribute nsISupports securityInfo; */
    pub GetSecurityInfo: unsafe extern "system" fn (this: *const nsISocketTransport, aSecurityInfo: *mut *const nsISupports) -> nsresult,

    /* attribute nsIInterfaceRequestor securityCallbacks; */
    pub GetSecurityCallbacks: unsafe extern "system" fn (this: *const nsISocketTransport, aSecurityCallbacks: *mut *const nsIInterfaceRequestor) -> nsresult,

    /* attribute nsIInterfaceRequestor securityCallbacks; */
    pub SetSecurityCallbacks: unsafe extern "system" fn (this: *const nsISocketTransport, aSecurityCallbacks: *const nsIInterfaceRequestor) -> nsresult,

    /* boolean isAlive (); */
    pub IsAlive: unsafe extern "system" fn (this: *const nsISocketTransport, _retval: *mut bool) -> nsresult,

    /* unsigned long getTimeout (in unsigned long aType); */
    pub GetTimeout: unsafe extern "system" fn (this: *const nsISocketTransport, aType: libc::uint32_t, _retval: *mut libc::uint32_t) -> nsresult,

    /* void setTimeout (in unsigned long aType, in unsigned long aValue); */
    pub SetTimeout: unsafe extern "system" fn (this: *const nsISocketTransport, aType: libc::uint32_t, aValue: libc::uint32_t) -> nsresult,

    /* void setReuseAddrPort (in bool reuseAddrPort); */
    pub SetReuseAddrPort: unsafe extern "system" fn (this: *const nsISocketTransport, reuseAddrPort: bool) -> nsresult,

    /* attribute unsigned long connectionFlags; */
    pub GetConnectionFlags: unsafe extern "system" fn (this: *const nsISocketTransport, aConnectionFlags: *mut libc::uint32_t) -> nsresult,

    /* attribute unsigned long connectionFlags; */
    pub SetConnectionFlags: unsafe extern "system" fn (this: *const nsISocketTransport, aConnectionFlags: libc::uint32_t) -> nsresult,

    /* attribute unsigned long tlsFlags; */
    pub GetTlsFlags: unsafe extern "system" fn (this: *const nsISocketTransport, aTlsFlags: *mut libc::uint32_t) -> nsresult,

    /* attribute unsigned long tlsFlags; */
    pub SetTlsFlags: unsafe extern "system" fn (this: *const nsISocketTransport, aTlsFlags: libc::uint32_t) -> nsresult,

    /* attribute octet QoSBits; */
    pub GetQoSBits: unsafe extern "system" fn (this: *const nsISocketTransport, aQoSBits: *mut libc::uint8_t) -> nsresult,

    /* attribute octet QoSBits; */
    pub SetQoSBits: unsafe extern "system" fn (this: *const nsISocketTransport, aQoSBits: libc::uint8_t) -> nsresult,

    /* attribute unsigned long recvBufferSize; */
    pub GetRecvBufferSize: unsafe extern "system" fn (this: *const nsISocketTransport, aRecvBufferSize: *mut libc::uint32_t) -> nsresult,

    /* attribute unsigned long recvBufferSize; */
    pub SetRecvBufferSize: unsafe extern "system" fn (this: *const nsISocketTransport, aRecvBufferSize: libc::uint32_t) -> nsresult,

    /* attribute unsigned long sendBufferSize; */
    pub GetSendBufferSize: unsafe extern "system" fn (this: *const nsISocketTransport, aSendBufferSize: *mut libc::uint32_t) -> nsresult,

    /* attribute unsigned long sendBufferSize; */
    pub SetSendBufferSize: unsafe extern "system" fn (this: *const nsISocketTransport, aSendBufferSize: libc::uint32_t) -> nsresult,

    /* attribute boolean keepaliveEnabled; */
    pub GetKeepaliveEnabled: unsafe extern "system" fn (this: *const nsISocketTransport, aKeepaliveEnabled: *mut bool) -> nsresult,

    /* attribute boolean keepaliveEnabled; */
    pub SetKeepaliveEnabled: unsafe extern "system" fn (this: *const nsISocketTransport, aKeepaliveEnabled: bool) -> nsresult,

    /* void setKeepaliveVals (in long keepaliveIdleTime, in long keepaliveRetryInterval); */
    pub SetKeepaliveVals: unsafe extern "system" fn (this: *const nsISocketTransport, keepaliveIdleTime: libc::int32_t, keepaliveRetryInterval: libc::int32_t) -> nsresult,

    /* [noscript] void setFastOpenCallback (in TCPFastOpenPtr aFastOpen); */
    /// Unable to generate binding because `native type mozilla::net::TCPFastOpen is unsupported`
    pub SetFastOpenCallback: *const ::libc::c_void,

    /* readonly attribute nsresult firstRetryError; */
    pub GetFirstRetryError: unsafe extern "system" fn (this: *const nsISocketTransport, aFirstRetryError: *mut nsresult) -> nsresult,
}


// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsISocketTransport {
    /// ```text
    /// /**
    ///      * Values for the aType parameter passed to get/setTimeout.
    ///      */
    /// ```
    ///

    pub const TIMEOUT_CONNECT: i64 = 0;


    pub const TIMEOUT_READ_WRITE: i64 = 1;

    /// ```text
    /// /**
    ///      * nsITransportEventSink status codes.
    ///      *
    ///      * Although these look like XPCOM error codes and are passed in an nsresult
    ///      * variable, they are *not* error codes.  Note that while they *do* overlap
    ///      * with existing error codes in Necko, these status codes are confined
    ///      * within a very limited context where no error codes may appear, so there
    ///      * is no ambiguity.
    ///      *
    ///      * The values of these status codes must never change.
    ///      *
    ///      * The status codes appear in near-chronological order (not in numeric
        ///      * order).  STATUS_RESOLVING may be skipped if the host does not need to be
    ///      * resolved.  STATUS_WAITING_FOR is an optional status code, which the impl
    ///      * of this interface may choose not to generate.
    ///      *
    ///      * In C++, these constants have a type of uint32_t, so C++ callers must use
    ///      * the NS_NET_STATUS_* constants defined below, which have a type of
    ///      * nsresult.
    ///      */
    /// ```
    ///

    pub const STATUS_RESOLVING: i64 = 2152398851;


    pub const STATUS_RESOLVED: i64 = 2152398859;


    pub const STATUS_CONNECTING_TO: i64 = 2152398855;


    pub const STATUS_CONNECTED_TO: i64 = 2152398852;


    pub const STATUS_SENDING_TO: i64 = 2152398853;


    pub const STATUS_WAITING_FOR: i64 = 2152398858;


    pub const STATUS_RECEIVING_FROM: i64 = 2152398854;


    pub const STATUS_TLS_HANDSHAKE_STARTING: i64 = 2152398860;


    pub const STATUS_TLS_HANDSHAKE_ENDED: i64 = 2152398861;

    /// ```text
    /// /**
    ///      * Values for the connectionFlags
    ///      *
    ///      * When making a new connection BYPASS_CACHE will force the Necko DNS
    ///      * cache entry to be refreshed with a new call to NSPR if it is set before
    ///      * opening the new stream.
    ///      */
    /// ```
    ///

    pub const BYPASS_CACHE: i64 = 1;

    /// ```text
    /// /**
    ///      * When setting this flag, the socket will not apply any
    ///      * credentials when establishing a connection. For example,
    ///      * an SSL connection would not send any client-certificates
    ///      * if this flag is set.
    ///      */
    /// ```
    ///

    pub const ANONYMOUS_CONNECT: i64 = 2;

    /// ```text
    /// /**
    ///      * If set, we will skip all IPv6 addresses the host may have and only
    ///      * connect to IPv4 ones.
    ///      */
    /// ```
    ///

    pub const DISABLE_IPV6: i64 = 4;

    /// ```text
    /// /**
    ///      * If set, indicates that the connection was initiated from a source
    ///      * defined as being private in the sense of Private Browsing. Generally,
    ///      * there should be no state shared between connections that are private
    ///      * and those that are not; it is OK for multiple private connections
    ///      * to share state with each other, and it is OK for multiple non-private
    ///      * connections to share state with each other.
    ///      */
    /// ```
    ///

    pub const NO_PERMANENT_STORAGE: i64 = 8;

    /// ```text
    /// /**
    ///      * If set, we will skip all IPv4 addresses the host may have and only
    ///      * connect to IPv6 ones.
    ///      */
    /// ```
    ///

    pub const DISABLE_IPV4: i64 = 16;

    /// ```text
    /// /**
    ///      * If set, indicates that the socket should not connect if the hostname
    ///      * resolves to an RFC1918 address or IPv6 equivalent.
    ///      */
    /// ```
    ///

    pub const DISABLE_RFC1918: i64 = 32;

    /// ```text
    /// /**
    ///      * This flag is an explicit opt-in that allows a normally secure socket
    ///      * provider to use, at its discretion, an insecure algorithm. e.g.
    ///      * a TLS socket without authentication.
    ///      */
    /// ```
    ///

    pub const MITM_OK: i64 = 64;

    /// ```text
    /// /**
    ///      * If set, do not use newer protocol features that might have interop problems
    ///      * on the Internet. Intended only for use with critical infra like the updater.
    ///      * default is false.
    ///      */
    /// ```
    ///

    pub const BE_CONSERVATIVE: i64 = 128;

    /// ```text
    /// /**
    ///      * Get the peer's host for the underlying socket connection.
    ///      * For Unix domain sockets, this is a pathname, or the empty string for
    ///      * unnamed and abstract socket addresses.
    ///      */
    /// ```
    ///

    /// `readonly attribute AUTF8String host;`
    #[inline]
    pub unsafe fn GetHost(&self, aHost: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetHost)(self, aHost)
    }


    /// ```text
    /// /**
    ///      * Get the port for the underlying socket connection.
    ///      * For Unix domain sockets, this is zero.
    ///      */
    /// ```
    ///

    /// `readonly attribute long port;`
    #[inline]
    pub unsafe fn GetPort(&self, aPort: *mut libc::int32_t) -> nsresult {
        ((*self.vtable).GetPort)(self, aPort)
    }


    /// ```text
    /// /**
    ///      * The origin attributes are used to create sockets.  The first party domain
    ///      * will eventually be used to isolate OCSP cache and is only non-empty when
    ///      * "privacy.firstparty.isolate" is enabled.  Setting this is the only way to
    ///      * carry origin attributes down to NSPR layers which are final consumers.
    ///      * It must be set before the socket transport is built.
    ///      */
    /// ```
    ///

    /// `[binaryname(ScriptableOriginAttributes),implicit_jscontext] attribute jsval originAttributes;`
    const _GetScriptableOriginAttributes: () = ();

    /// ```text
    /// /**
    ///      * The origin attributes are used to create sockets.  The first party domain
    ///      * will eventually be used to isolate OCSP cache and is only non-empty when
    ///      * "privacy.firstparty.isolate" is enabled.  Setting this is the only way to
    ///      * carry origin attributes down to NSPR layers which are final consumers.
    ///      * It must be set before the socket transport is built.
    ///      */
    /// ```
    ///

    /// `[binaryname(ScriptableOriginAttributes),implicit_jscontext] attribute jsval originAttributes;`
    const _SetScriptableOriginAttributes: () = ();


    /// `[binaryname(GetOriginAttributes),noscript,nostdcall] OriginAttributes binaryGetOriginAttributes ();`
    const _GetOriginAttributes: () = ();


    /// `[binaryname(SetOriginAttributes),noscript,nostdcall] void binarySetOriginAttributes (in const_OriginAttributesRef aOriginAttrs);`
    const _SetOriginAttributes: () = ();

    /// ```text
    /// /**
    ///      * The platform-specific network interface id that this socket
    ///      * associated with. Note that this attribute can be only accessed
    ///      * in the socket thread.
    ///      */
    /// ```
    ///

    /// `attribute ACString networkInterfaceId;`
    #[inline]
    pub unsafe fn GetNetworkInterfaceId(&self, aNetworkInterfaceId: &mut ::nsstring::nsACString) -> nsresult {
        ((*self.vtable).GetNetworkInterfaceId)(self, aNetworkInterfaceId)
    }


    /// ```text
    /// /**
    ///      * The platform-specific network interface id that this socket
    ///      * associated with. Note that this attribute can be only accessed
    ///      * in the socket thread.
    ///      */
    /// ```
    ///

    /// `attribute ACString networkInterfaceId;`
    #[inline]
    pub unsafe fn SetNetworkInterfaceId(&self, aNetworkInterfaceId: &::nsstring::nsACString) -> nsresult {
        ((*self.vtable).SetNetworkInterfaceId)(self, aNetworkInterfaceId)
    }


    /// ```text
    /// /**
    ///      * Returns the IP address of the socket connection peer. This
    ///      * attribute is defined only once a connection has been established.
    ///      */
    /// ```
    ///

    /// `[noscript] NetAddr getPeerAddr ();`
    const _GetPeerAddr: () = ();

    /// ```text
    /// /**
    ///      * Returns the IP address of the initiating end. This attribute
    ///      * is defined only once a connection has been established.
    ///      */
    /// ```
    ///

    /// `[noscript] NetAddr getSelfAddr ();`
    const _GetSelfAddr: () = ();

    /// ```text
    /// /**
    ///      * Bind to a specific local address.
    ///      */
    /// ```
    ///

    /// `[noscript] void bind (in NetAddrPtr aLocalAddr);`
    const _Bind: () = ();

    /// ```text
    /// /**
    ///      * Returns a scriptable version of getPeerAddr. This attribute is defined
    ///      * only once a connection has been established.
    ///      */
    /// ```
    ///

    /// `nsINetAddr getScriptablePeerAddr ();`
    #[inline]
    pub unsafe fn GetScriptablePeerAddr(&self, _retval: *mut *const nsINetAddr) -> nsresult {
        ((*self.vtable).GetScriptablePeerAddr)(self, _retval)
    }


    /// ```text
    /// /**
    ///      * Returns a scriptable version of getSelfAddr. This attribute is defined
    ///      * only once a connection has been established.
    ///      */
    /// ```
    ///

    /// `nsINetAddr getScriptableSelfAddr ();`
    #[inline]
    pub unsafe fn GetScriptableSelfAddr(&self, _retval: *mut *const nsINetAddr) -> nsresult {
        ((*self.vtable).GetScriptableSelfAddr)(self, _retval)
    }


    /// ```text
    /// /**
    ///      * Security info object returned from the secure socket provider.  This
    ///      * object supports nsISSLSocketControl, nsITransportSecurityInfo, and
    ///      * possibly other interfaces.
    ///      *
    ///      * This attribute is only available once the socket is connected.
    ///      */
    /// ```
    ///

    /// `readonly attribute nsISupports securityInfo;`
    #[inline]
    pub unsafe fn GetSecurityInfo(&self, aSecurityInfo: *mut *const nsISupports) -> nsresult {
        ((*self.vtable).GetSecurityInfo)(self, aSecurityInfo)
    }


    /// ```text
    /// /**
    ///      * Security notification callbacks passed to the secure socket provider
    ///      * via nsISSLSocketControl at socket creation time.
    ///      *
    ///      * NOTE: this attribute cannot be changed once a stream has been opened.
    ///      */
    /// ```
    ///

    /// `attribute nsIInterfaceRequestor securityCallbacks;`
    #[inline]
    pub unsafe fn GetSecurityCallbacks(&self, aSecurityCallbacks: *mut *const nsIInterfaceRequestor) -> nsresult {
        ((*self.vtable).GetSecurityCallbacks)(self, aSecurityCallbacks)
    }


    /// ```text
    /// /**
    ///      * Security notification callbacks passed to the secure socket provider
    ///      * via nsISSLSocketControl at socket creation time.
    ///      *
    ///      * NOTE: this attribute cannot be changed once a stream has been opened.
    ///      */
    /// ```
    ///

    /// `attribute nsIInterfaceRequestor securityCallbacks;`
    #[inline]
    pub unsafe fn SetSecurityCallbacks(&self, aSecurityCallbacks: *const nsIInterfaceRequestor) -> nsresult {
        ((*self.vtable).SetSecurityCallbacks)(self, aSecurityCallbacks)
    }


    /// ```text
    /// /**
    ///      * Test if this socket transport is (still) connected.
    ///      */
    /// ```
    ///

    /// `boolean isAlive ();`
    #[inline]
    pub unsafe fn IsAlive(&self, _retval: *mut bool) -> nsresult {
        ((*self.vtable).IsAlive)(self, _retval)
    }


    /// ```text
    /// /**
    ///      * Socket timeouts in seconds.  To specify no timeout, pass UINT32_MAX
    ///      * as aValue to setTimeout.  The implementation may truncate timeout values
    ///      * to a smaller range of values (e.g., 0 to 0xFFFF).
    ///      */
    /// ```
    ///

    /// `unsigned long getTimeout (in unsigned long aType);`
    #[inline]
    pub unsafe fn GetTimeout(&self, aType: libc::uint32_t, _retval: *mut libc::uint32_t) -> nsresult {
        ((*self.vtable).GetTimeout)(self, aType, _retval)
    }



    /// `void setTimeout (in unsigned long aType, in unsigned long aValue);`
    #[inline]
    pub unsafe fn SetTimeout(&self, aType: libc::uint32_t, aValue: libc::uint32_t) -> nsresult {
        ((*self.vtable).SetTimeout)(self, aType, aValue)
    }


    /// ```text
    /// /**
    ///      * True to set addr and port reuse socket options.
    ///      */
    /// ```
    ///

    /// `void setReuseAddrPort (in bool reuseAddrPort);`
    #[inline]
    pub unsafe fn SetReuseAddrPort(&self, reuseAddrPort: bool) -> nsresult {
        ((*self.vtable).SetReuseAddrPort)(self, reuseAddrPort)
    }


    /// ```text
    /// /**
    ///      * connectionFlags is a bitmask that can be used to modify underlying
    ///      * behavior of the socket connection. See the flags below.
    ///      */
    /// ```
    ///

    /// `attribute unsigned long connectionFlags;`
    #[inline]
    pub unsafe fn GetConnectionFlags(&self, aConnectionFlags: *mut libc::uint32_t) -> nsresult {
        ((*self.vtable).GetConnectionFlags)(self, aConnectionFlags)
    }


    /// ```text
    /// /**
    ///      * connectionFlags is a bitmask that can be used to modify underlying
    ///      * behavior of the socket connection. See the flags below.
    ///      */
    /// ```
    ///

    /// `attribute unsigned long connectionFlags;`
    #[inline]
    pub unsafe fn SetConnectionFlags(&self, aConnectionFlags: libc::uint32_t) -> nsresult {
        ((*self.vtable).SetConnectionFlags)(self, aConnectionFlags)
    }


    /// ```text
    /// /**
    ///      * An opaque flags for non-standard behavior of the TLS system.
    ///      * It is unlikely this will need to be set outside of telemetry studies
    ///      * relating to the TLS implementation.
    ///      */
    /// ```
    ///

    /// `attribute unsigned long tlsFlags;`
    #[inline]
    pub unsafe fn GetTlsFlags(&self, aTlsFlags: *mut libc::uint32_t) -> nsresult {
        ((*self.vtable).GetTlsFlags)(self, aTlsFlags)
    }


    /// ```text
    /// /**
    ///      * An opaque flags for non-standard behavior of the TLS system.
    ///      * It is unlikely this will need to be set outside of telemetry studies
    ///      * relating to the TLS implementation.
    ///      */
    /// ```
    ///

    /// `attribute unsigned long tlsFlags;`
    #[inline]
    pub unsafe fn SetTlsFlags(&self, aTlsFlags: libc::uint32_t) -> nsresult {
        ((*self.vtable).SetTlsFlags)(self, aTlsFlags)
    }


    /// ```text
    /// /**
    ///      * Socket QoS/ToS markings. Valid values are IPTOS_DSCP_AFxx or
    ///      * IPTOS_CLASS_CSx (or IPTOS_DSCP_EF, but currently no supported
        ///      * services require expedited-forwarding).
    ///      * Not setting this value will leave the socket with the default
    ///      * ToS value, which on most systems if IPTOS_CLASS_CS0 (formerly
        ///      * IPTOS_PREC_ROUTINE).
    ///      */
    /// ```
    ///

    /// `attribute octet QoSBits;`
    #[inline]
    pub unsafe fn GetQoSBits(&self, aQoSBits: *mut libc::uint8_t) -> nsresult {
        ((*self.vtable).GetQoSBits)(self, aQoSBits)
    }


    /// ```text
    /// /**
    ///      * Socket QoS/ToS markings. Valid values are IPTOS_DSCP_AFxx or
    ///      * IPTOS_CLASS_CSx (or IPTOS_DSCP_EF, but currently no supported
        ///      * services require expedited-forwarding).
    ///      * Not setting this value will leave the socket with the default
    ///      * ToS value, which on most systems if IPTOS_CLASS_CS0 (formerly
        ///      * IPTOS_PREC_ROUTINE).
    ///      */
    /// ```
    ///

    /// `attribute octet QoSBits;`
    #[inline]
    pub unsafe fn SetQoSBits(&self, aQoSBits: libc::uint8_t) -> nsresult {
        ((*self.vtable).SetQoSBits)(self, aQoSBits)
    }


    /// ```text
    /// /**
    ///      * TCP send and receive buffer sizes. A value of 0 means OS level
    ///      * auto-tuning is in effect.
    ///      */
    /// ```
    ///

    /// `attribute unsigned long recvBufferSize;`
    #[inline]
    pub unsafe fn GetRecvBufferSize(&self, aRecvBufferSize: *mut libc::uint32_t) -> nsresult {
        ((*self.vtable).GetRecvBufferSize)(self, aRecvBufferSize)
    }


    /// ```text
    /// /**
    ///      * TCP send and receive buffer sizes. A value of 0 means OS level
    ///      * auto-tuning is in effect.
    ///      */
    /// ```
    ///

    /// `attribute unsigned long recvBufferSize;`
    #[inline]
    pub unsafe fn SetRecvBufferSize(&self, aRecvBufferSize: libc::uint32_t) -> nsresult {
        ((*self.vtable).SetRecvBufferSize)(self, aRecvBufferSize)
    }



    /// `attribute unsigned long sendBufferSize;`
    #[inline]
    pub unsafe fn GetSendBufferSize(&self, aSendBufferSize: *mut libc::uint32_t) -> nsresult {
        ((*self.vtable).GetSendBufferSize)(self, aSendBufferSize)
    }



    /// `attribute unsigned long sendBufferSize;`
    #[inline]
    pub unsafe fn SetSendBufferSize(&self, aSendBufferSize: libc::uint32_t) -> nsresult {
        ((*self.vtable).SetSendBufferSize)(self, aSendBufferSize)
    }


    /// ```text
    /// /**
    ///      * TCP keepalive configuration (support varies by platform).
    ///      * Note that the attribute as well as the setter can only accessed
    ///      * in the socket thread.
    ///      */
    /// ```
    ///

    /// `attribute boolean keepaliveEnabled;`
    #[inline]
    pub unsafe fn GetKeepaliveEnabled(&self, aKeepaliveEnabled: *mut bool) -> nsresult {
        ((*self.vtable).GetKeepaliveEnabled)(self, aKeepaliveEnabled)
    }


    /// ```text
    /// /**
    ///      * TCP keepalive configuration (support varies by platform).
    ///      * Note that the attribute as well as the setter can only accessed
    ///      * in the socket thread.
    ///      */
    /// ```
    ///

    /// `attribute boolean keepaliveEnabled;`
    #[inline]
    pub unsafe fn SetKeepaliveEnabled(&self, aKeepaliveEnabled: bool) -> nsresult {
        ((*self.vtable).SetKeepaliveEnabled)(self, aKeepaliveEnabled)
    }



    /// `void setKeepaliveVals (in long keepaliveIdleTime, in long keepaliveRetryInterval);`
    #[inline]
    pub unsafe fn SetKeepaliveVals(&self, keepaliveIdleTime: libc::int32_t, keepaliveRetryInterval: libc::int32_t) -> nsresult {
        ((*self.vtable).SetKeepaliveVals)(self, keepaliveIdleTime, keepaliveRetryInterval)
    }



    /// `[noscript] void setFastOpenCallback (in TCPFastOpenPtr aFastOpen);`
    const _SetFastOpenCallback: () = ();


    /// `readonly attribute nsresult firstRetryError;`
    #[inline]
    pub unsafe fn GetFirstRetryError(&self, aFirstRetryError: *mut nsresult) -> nsresult {
        ((*self.vtable).GetFirstRetryError)(self, aFirstRetryError)
    }


}