nm_rs/auto/
setting_ppp.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir
3// from gtk-girs (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6use crate::{ffi,Setting};
7use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
8use std::{boxed::Box as Box_};
9
10glib::wrapper! {
11    /// Point-to-Point Protocol Settings
12    ///
13    /// ## Properties
14    ///
15    ///
16    /// #### `baud`
17    ///  If non-zero, instruct pppd to set the serial port to the specified
18    /// baudrate.  This value should normally be left as 0 to automatically
19    /// choose the speed.
20    ///
21    /// Readable | Writeable
22    ///
23    ///
24    /// #### `crtscts`
25    ///  If [`true`], specify that pppd should set the serial port to use hardware
26    /// flow control with RTS and CTS signals.  This value should normally be set
27    /// to [`false`].
28    ///
29    /// Readable | Writeable
30    ///
31    ///
32    /// #### `lcp-echo-failure`
33    ///  If non-zero, instruct pppd to presume the connection to the peer has
34    /// failed if the specified number of LCP echo-requests go unanswered by the
35    /// peer.  The "lcp-echo-interval" property must also be set to a non-zero
36    /// value if this property is used.
37    ///
38    /// Readable | Writeable
39    ///
40    ///
41    /// #### `lcp-echo-interval`
42    ///  If non-zero, instruct pppd to send an LCP echo-request frame to the peer
43    /// every n seconds (where n is the specified value).  Note that some PPP
44    /// peers will respond to echo requests and some will not, and it is not
45    /// possible to autodetect this.
46    ///
47    /// Readable | Writeable
48    ///
49    ///
50    /// #### `mppe-stateful`
51    ///  If [`true`], stateful MPPE is used.  See pppd documentation for more
52    /// information on stateful MPPE.
53    ///
54    /// Readable | Writeable
55    ///
56    ///
57    /// #### `mru`
58    ///  If non-zero, instruct pppd to request that the peer send packets no
59    /// larger than the specified size.  If non-zero, the MRU should be between
60    /// 128 and 16384.
61    ///
62    /// Readable | Writeable
63    ///
64    ///
65    /// #### `mtu`
66    ///  If non-zero, instruct pppd to send packets no larger than the specified
67    /// size.
68    ///
69    /// Readable | Writeable
70    ///
71    ///
72    /// #### `no-vj-comp`
73    ///  If [`true`], Van Jacobsen TCP header compression will not be requested.
74    ///
75    /// Readable | Writeable
76    ///
77    ///
78    /// #### `noauth`
79    ///  If [`true`], do not require the other side (usually the PPP server) to
80    /// authenticate itself to the client.  If [`false`], require authentication
81    /// from the remote side.  In almost all cases, this should be [`true`].
82    ///
83    /// Readable | Writeable
84    ///
85    ///
86    /// #### `nobsdcomp`
87    ///  If [`true`], BSD compression will not be requested.
88    ///
89    /// Readable | Writeable
90    ///
91    ///
92    /// #### `nodeflate`
93    ///  If [`true`], "deflate" compression will not be requested.
94    ///
95    /// Readable | Writeable
96    ///
97    ///
98    /// #### `refuse-chap`
99    ///  If [`true`], the CHAP authentication method will not be used.
100    ///
101    /// Readable | Writeable
102    ///
103    ///
104    /// #### `refuse-eap`
105    ///  If [`true`], the EAP authentication method will not be used.
106    ///
107    /// Readable | Writeable
108    ///
109    ///
110    /// #### `refuse-mschap`
111    ///  If [`true`], the MSCHAP authentication method will not be used.
112    ///
113    /// Readable | Writeable
114    ///
115    ///
116    /// #### `refuse-mschapv2`
117    ///  If [`true`], the MSCHAPv2 authentication method will not be used.
118    ///
119    /// Readable | Writeable
120    ///
121    ///
122    /// #### `refuse-pap`
123    ///  If [`true`], the PAP authentication method will not be used.
124    ///
125    /// Readable | Writeable
126    ///
127    ///
128    /// #### `require-mppe`
129    ///  If [`true`], MPPE (Microsoft Point-to-Point Encryption) will be required for
130    /// the PPP session.  If either 64-bit or 128-bit MPPE is not available the
131    /// session will fail.  Note that MPPE is not used on mobile broadband
132    /// connections.
133    ///
134    /// Readable | Writeable
135    ///
136    ///
137    /// #### `require-mppe-128`
138    ///  If [`true`], 128-bit MPPE (Microsoft Point-to-Point Encryption) will be
139    /// required for the PPP session, and the "require-mppe" property must also
140    /// be set to [`true`].  If 128-bit MPPE is not available the session will fail.
141    ///
142    /// Readable | Writeable
143    /// <details><summary><h4>Setting</h4></summary>
144    ///
145    ///
146    /// #### `name`
147    ///  The setting's name, which uniquely identifies the setting within the
148    /// connection.  Each setting type has a name unique to that type, for
149    /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
150    ///
151    /// Readable
152    /// </details>
153    ///
154    /// # Implements
155    ///
156    /// [`SettingExt`][trait@crate::prelude::SettingExt]
157    #[doc(alias = "NMSettingPpp")]
158    pub struct SettingPpp(Object<ffi::NMSettingPpp, ffi::NMSettingPppClass>) @extends Setting;
159
160    match fn {
161        type_ => || ffi::nm_setting_ppp_get_type(),
162    }
163}
164
165impl SettingPpp {
166    /// Creates a new #NMSettingPpp object with default values.
167    ///
168    /// # Returns
169    ///
170    /// the new empty #NMSettingPpp object
171    #[doc(alias = "nm_setting_ppp_new")]
172    pub fn new() -> SettingPpp {
173        assert_initialized_main_thread!();
174        unsafe {
175            Setting::from_glib_full(ffi::nm_setting_ppp_new()).unsafe_cast()
176        }
177    }
178
179            // rustdoc-stripper-ignore-next
180            /// Creates a new builder-pattern struct instance to construct [`SettingPpp`] objects.
181            ///
182            /// This method returns an instance of [`SettingPppBuilder`](crate::builders::SettingPppBuilder) which can be used to create [`SettingPpp`] objects.
183            pub fn builder() -> SettingPppBuilder {
184                SettingPppBuilder::new()
185            }
186        
187
188    ///
189    /// # Returns
190    ///
191    /// the #NMSettingPpp:baud property of the setting
192    #[doc(alias = "nm_setting_ppp_get_baud")]
193    #[doc(alias = "get_baud")]
194    pub fn baud(&self) -> u32 {
195        unsafe {
196            ffi::nm_setting_ppp_get_baud(self.to_glib_none().0)
197        }
198    }
199
200    ///
201    /// # Returns
202    ///
203    /// the #NMSettingPpp:crtscts property of the setting
204    #[doc(alias = "nm_setting_ppp_get_crtscts")]
205    #[doc(alias = "get_crtscts")]
206    #[doc(alias = "crtscts")]
207    pub fn is_crtscts(&self) -> bool {
208        unsafe {
209            from_glib(ffi::nm_setting_ppp_get_crtscts(self.to_glib_none().0))
210        }
211    }
212
213    ///
214    /// # Returns
215    ///
216    /// the #NMSettingPpp:lcp-echo-failure property of the setting
217    #[doc(alias = "nm_setting_ppp_get_lcp_echo_failure")]
218    #[doc(alias = "get_lcp_echo_failure")]
219    #[doc(alias = "lcp-echo-failure")]
220    pub fn lcp_echo_failure(&self) -> u32 {
221        unsafe {
222            ffi::nm_setting_ppp_get_lcp_echo_failure(self.to_glib_none().0)
223        }
224    }
225
226    ///
227    /// # Returns
228    ///
229    /// the #NMSettingPpp:lcp-echo-interval property of the setting
230    #[doc(alias = "nm_setting_ppp_get_lcp_echo_interval")]
231    #[doc(alias = "get_lcp_echo_interval")]
232    #[doc(alias = "lcp-echo-interval")]
233    pub fn lcp_echo_interval(&self) -> u32 {
234        unsafe {
235            ffi::nm_setting_ppp_get_lcp_echo_interval(self.to_glib_none().0)
236        }
237    }
238
239    ///
240    /// # Returns
241    ///
242    /// the #NMSettingPpp:mppe-stateful property of the setting
243    #[doc(alias = "nm_setting_ppp_get_mppe_stateful")]
244    #[doc(alias = "get_mppe_stateful")]
245    #[doc(alias = "mppe-stateful")]
246    pub fn is_mppe_stateful(&self) -> bool {
247        unsafe {
248            from_glib(ffi::nm_setting_ppp_get_mppe_stateful(self.to_glib_none().0))
249        }
250    }
251
252    ///
253    /// # Returns
254    ///
255    /// the #NMSettingPpp:mru property of the setting
256    #[doc(alias = "nm_setting_ppp_get_mru")]
257    #[doc(alias = "get_mru")]
258    pub fn mru(&self) -> u32 {
259        unsafe {
260            ffi::nm_setting_ppp_get_mru(self.to_glib_none().0)
261        }
262    }
263
264    ///
265    /// # Returns
266    ///
267    /// the #NMSettingPpp:mtu property of the setting
268    #[doc(alias = "nm_setting_ppp_get_mtu")]
269    #[doc(alias = "get_mtu")]
270    pub fn mtu(&self) -> u32 {
271        unsafe {
272            ffi::nm_setting_ppp_get_mtu(self.to_glib_none().0)
273        }
274    }
275
276    ///
277    /// # Returns
278    ///
279    /// the #NMSettingPpp:no-vj-comp property of the setting
280    #[doc(alias = "nm_setting_ppp_get_no_vj_comp")]
281    #[doc(alias = "get_no_vj_comp")]
282    #[doc(alias = "no-vj-comp")]
283    pub fn is_no_vj_comp(&self) -> bool {
284        unsafe {
285            from_glib(ffi::nm_setting_ppp_get_no_vj_comp(self.to_glib_none().0))
286        }
287    }
288
289    ///
290    /// # Returns
291    ///
292    /// the #NMSettingPpp:noauth property of the setting
293    #[doc(alias = "nm_setting_ppp_get_noauth")]
294    #[doc(alias = "get_noauth")]
295    #[doc(alias = "noauth")]
296    pub fn is_noauth(&self) -> bool {
297        unsafe {
298            from_glib(ffi::nm_setting_ppp_get_noauth(self.to_glib_none().0))
299        }
300    }
301
302    ///
303    /// # Returns
304    ///
305    /// the #NMSettingPpp:nobsdcomp property of the setting
306    #[doc(alias = "nm_setting_ppp_get_nobsdcomp")]
307    #[doc(alias = "get_nobsdcomp")]
308    #[doc(alias = "nobsdcomp")]
309    pub fn is_nobsdcomp(&self) -> bool {
310        unsafe {
311            from_glib(ffi::nm_setting_ppp_get_nobsdcomp(self.to_glib_none().0))
312        }
313    }
314
315    ///
316    /// # Returns
317    ///
318    /// the #NMSettingPpp:nodeflate property of the setting
319    #[doc(alias = "nm_setting_ppp_get_nodeflate")]
320    #[doc(alias = "get_nodeflate")]
321    #[doc(alias = "nodeflate")]
322    pub fn is_nodeflate(&self) -> bool {
323        unsafe {
324            from_glib(ffi::nm_setting_ppp_get_nodeflate(self.to_glib_none().0))
325        }
326    }
327
328    ///
329    /// # Returns
330    ///
331    /// the #NMSettingPpp:refuse-chap property of the setting
332    #[doc(alias = "nm_setting_ppp_get_refuse_chap")]
333    #[doc(alias = "get_refuse_chap")]
334    #[doc(alias = "refuse-chap")]
335    pub fn is_refuse_chap(&self) -> bool {
336        unsafe {
337            from_glib(ffi::nm_setting_ppp_get_refuse_chap(self.to_glib_none().0))
338        }
339    }
340
341    ///
342    /// # Returns
343    ///
344    /// the #NMSettingPpp:refuse-eap property of the setting
345    #[doc(alias = "nm_setting_ppp_get_refuse_eap")]
346    #[doc(alias = "get_refuse_eap")]
347    #[doc(alias = "refuse-eap")]
348    pub fn is_refuse_eap(&self) -> bool {
349        unsafe {
350            from_glib(ffi::nm_setting_ppp_get_refuse_eap(self.to_glib_none().0))
351        }
352    }
353
354    ///
355    /// # Returns
356    ///
357    /// the #NMSettingPpp:refuse-mschap property of the setting
358    #[doc(alias = "nm_setting_ppp_get_refuse_mschap")]
359    #[doc(alias = "get_refuse_mschap")]
360    #[doc(alias = "refuse-mschap")]
361    pub fn is_refuse_mschap(&self) -> bool {
362        unsafe {
363            from_glib(ffi::nm_setting_ppp_get_refuse_mschap(self.to_glib_none().0))
364        }
365    }
366
367    ///
368    /// # Returns
369    ///
370    /// the #NMSettingPpp:refuse-mschapv2 property of the setting
371    #[doc(alias = "nm_setting_ppp_get_refuse_mschapv2")]
372    #[doc(alias = "get_refuse_mschapv2")]
373    #[doc(alias = "refuse-mschapv2")]
374    pub fn is_refuse_mschapv2(&self) -> bool {
375        unsafe {
376            from_glib(ffi::nm_setting_ppp_get_refuse_mschapv2(self.to_glib_none().0))
377        }
378    }
379
380    ///
381    /// # Returns
382    ///
383    /// the #NMSettingPpp:refuse-pap property of the setting
384    #[doc(alias = "nm_setting_ppp_get_refuse_pap")]
385    #[doc(alias = "get_refuse_pap")]
386    #[doc(alias = "refuse-pap")]
387    pub fn is_refuse_pap(&self) -> bool {
388        unsafe {
389            from_glib(ffi::nm_setting_ppp_get_refuse_pap(self.to_glib_none().0))
390        }
391    }
392
393    ///
394    /// # Returns
395    ///
396    /// the #NMSettingPpp:require-mppe property of the setting
397    #[doc(alias = "nm_setting_ppp_get_require_mppe")]
398    #[doc(alias = "get_require_mppe")]
399    #[doc(alias = "require-mppe")]
400    pub fn requires_mppe(&self) -> bool {
401        unsafe {
402            from_glib(ffi::nm_setting_ppp_get_require_mppe(self.to_glib_none().0))
403        }
404    }
405
406    ///
407    /// # Returns
408    ///
409    /// the #NMSettingPpp:require-mppe-128 property of the setting
410    #[doc(alias = "nm_setting_ppp_get_require_mppe_128")]
411    #[doc(alias = "get_require_mppe_128")]
412    #[doc(alias = "require-mppe-128")]
413    pub fn requires_mppe_128(&self) -> bool {
414        unsafe {
415            from_glib(ffi::nm_setting_ppp_get_require_mppe_128(self.to_glib_none().0))
416        }
417    }
418
419    /// If non-zero, instruct pppd to set the serial port to the specified
420    /// baudrate.  This value should normally be left as 0 to automatically
421    /// choose the speed.
422    pub fn set_baud(&self, baud: u32) {
423        ObjectExt::set_property(self,"baud", baud)
424    }
425
426    /// If [`true`], specify that pppd should set the serial port to use hardware
427    /// flow control with RTS and CTS signals.  This value should normally be set
428    /// to [`false`].
429    pub fn set_crtscts(&self, crtscts: bool) {
430        ObjectExt::set_property(self,"crtscts", crtscts)
431    }
432
433    /// If non-zero, instruct pppd to presume the connection to the peer has
434    /// failed if the specified number of LCP echo-requests go unanswered by the
435    /// peer.  The "lcp-echo-interval" property must also be set to a non-zero
436    /// value if this property is used.
437    #[doc(alias = "lcp-echo-failure")]
438    pub fn set_lcp_echo_failure(&self, lcp_echo_failure: u32) {
439        ObjectExt::set_property(self,"lcp-echo-failure", lcp_echo_failure)
440    }
441
442    /// If non-zero, instruct pppd to send an LCP echo-request frame to the peer
443    /// every n seconds (where n is the specified value).  Note that some PPP
444    /// peers will respond to echo requests and some will not, and it is not
445    /// possible to autodetect this.
446    #[doc(alias = "lcp-echo-interval")]
447    pub fn set_lcp_echo_interval(&self, lcp_echo_interval: u32) {
448        ObjectExt::set_property(self,"lcp-echo-interval", lcp_echo_interval)
449    }
450
451    /// If [`true`], stateful MPPE is used.  See pppd documentation for more
452    /// information on stateful MPPE.
453    #[doc(alias = "mppe-stateful")]
454    pub fn set_mppe_stateful(&self, mppe_stateful: bool) {
455        ObjectExt::set_property(self,"mppe-stateful", mppe_stateful)
456    }
457
458    /// If non-zero, instruct pppd to request that the peer send packets no
459    /// larger than the specified size.  If non-zero, the MRU should be between
460    /// 128 and 16384.
461    pub fn set_mru(&self, mru: u32) {
462        ObjectExt::set_property(self,"mru", mru)
463    }
464
465    /// If non-zero, instruct pppd to send packets no larger than the specified
466    /// size.
467    pub fn set_mtu(&self, mtu: u32) {
468        ObjectExt::set_property(self,"mtu", mtu)
469    }
470
471    /// If [`true`], Van Jacobsen TCP header compression will not be requested.
472    #[doc(alias = "no-vj-comp")]
473    pub fn set_no_vj_comp(&self, no_vj_comp: bool) {
474        ObjectExt::set_property(self,"no-vj-comp", no_vj_comp)
475    }
476
477    /// If [`true`], do not require the other side (usually the PPP server) to
478    /// authenticate itself to the client.  If [`false`], require authentication
479    /// from the remote side.  In almost all cases, this should be [`true`].
480    pub fn set_noauth(&self, noauth: bool) {
481        ObjectExt::set_property(self,"noauth", noauth)
482    }
483
484    /// If [`true`], BSD compression will not be requested.
485    pub fn set_nobsdcomp(&self, nobsdcomp: bool) {
486        ObjectExt::set_property(self,"nobsdcomp", nobsdcomp)
487    }
488
489    /// If [`true`], "deflate" compression will not be requested.
490    pub fn set_nodeflate(&self, nodeflate: bool) {
491        ObjectExt::set_property(self,"nodeflate", nodeflate)
492    }
493
494    /// If [`true`], the CHAP authentication method will not be used.
495    #[doc(alias = "refuse-chap")]
496    pub fn set_refuse_chap(&self, refuse_chap: bool) {
497        ObjectExt::set_property(self,"refuse-chap", refuse_chap)
498    }
499
500    /// If [`true`], the EAP authentication method will not be used.
501    #[doc(alias = "refuse-eap")]
502    pub fn set_refuse_eap(&self, refuse_eap: bool) {
503        ObjectExt::set_property(self,"refuse-eap", refuse_eap)
504    }
505
506    /// If [`true`], the MSCHAP authentication method will not be used.
507    #[doc(alias = "refuse-mschap")]
508    pub fn set_refuse_mschap(&self, refuse_mschap: bool) {
509        ObjectExt::set_property(self,"refuse-mschap", refuse_mschap)
510    }
511
512    /// If [`true`], the MSCHAPv2 authentication method will not be used.
513    #[doc(alias = "refuse-mschapv2")]
514    pub fn set_refuse_mschapv2(&self, refuse_mschapv2: bool) {
515        ObjectExt::set_property(self,"refuse-mschapv2", refuse_mschapv2)
516    }
517
518    /// If [`true`], the PAP authentication method will not be used.
519    #[doc(alias = "refuse-pap")]
520    pub fn set_refuse_pap(&self, refuse_pap: bool) {
521        ObjectExt::set_property(self,"refuse-pap", refuse_pap)
522    }
523
524    /// If [`true`], MPPE (Microsoft Point-to-Point Encryption) will be required for
525    /// the PPP session.  If either 64-bit or 128-bit MPPE is not available the
526    /// session will fail.  Note that MPPE is not used on mobile broadband
527    /// connections.
528    #[doc(alias = "require-mppe")]
529    pub fn set_require_mppe(&self, require_mppe: bool) {
530        ObjectExt::set_property(self,"require-mppe", require_mppe)
531    }
532
533    /// If [`true`], 128-bit MPPE (Microsoft Point-to-Point Encryption) will be
534    /// required for the PPP session, and the "require-mppe" property must also
535    /// be set to [`true`].  If 128-bit MPPE is not available the session will fail.
536    #[doc(alias = "require-mppe-128")]
537    pub fn set_require_mppe_128(&self, require_mppe_128: bool) {
538        ObjectExt::set_property(self,"require-mppe-128", require_mppe_128)
539    }
540
541    #[doc(alias = "baud")]
542    pub fn connect_baud_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
543        unsafe extern "C" fn notify_baud_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
544            let f: &F = &*(f as *const F);
545            f(&from_glib_borrow(this))
546        }
547        unsafe {
548            let f: Box_<F> = Box_::new(f);
549            connect_raw(self.as_ptr() as *mut _, c"notify::baud".as_ptr() as *const _,
550                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_baud_trampoline::<F> as *const ())), Box_::into_raw(f))
551        }
552    }
553
554    #[doc(alias = "crtscts")]
555    pub fn connect_crtscts_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
556        unsafe extern "C" fn notify_crtscts_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
557            let f: &F = &*(f as *const F);
558            f(&from_glib_borrow(this))
559        }
560        unsafe {
561            let f: Box_<F> = Box_::new(f);
562            connect_raw(self.as_ptr() as *mut _, c"notify::crtscts".as_ptr() as *const _,
563                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_crtscts_trampoline::<F> as *const ())), Box_::into_raw(f))
564        }
565    }
566
567    #[doc(alias = "lcp-echo-failure")]
568    pub fn connect_lcp_echo_failure_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
569        unsafe extern "C" fn notify_lcp_echo_failure_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
570            let f: &F = &*(f as *const F);
571            f(&from_glib_borrow(this))
572        }
573        unsafe {
574            let f: Box_<F> = Box_::new(f);
575            connect_raw(self.as_ptr() as *mut _, c"notify::lcp-echo-failure".as_ptr() as *const _,
576                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_lcp_echo_failure_trampoline::<F> as *const ())), Box_::into_raw(f))
577        }
578    }
579
580    #[doc(alias = "lcp-echo-interval")]
581    pub fn connect_lcp_echo_interval_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
582        unsafe extern "C" fn notify_lcp_echo_interval_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
583            let f: &F = &*(f as *const F);
584            f(&from_glib_borrow(this))
585        }
586        unsafe {
587            let f: Box_<F> = Box_::new(f);
588            connect_raw(self.as_ptr() as *mut _, c"notify::lcp-echo-interval".as_ptr() as *const _,
589                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_lcp_echo_interval_trampoline::<F> as *const ())), Box_::into_raw(f))
590        }
591    }
592
593    #[doc(alias = "mppe-stateful")]
594    pub fn connect_mppe_stateful_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
595        unsafe extern "C" fn notify_mppe_stateful_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
596            let f: &F = &*(f as *const F);
597            f(&from_glib_borrow(this))
598        }
599        unsafe {
600            let f: Box_<F> = Box_::new(f);
601            connect_raw(self.as_ptr() as *mut _, c"notify::mppe-stateful".as_ptr() as *const _,
602                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_mppe_stateful_trampoline::<F> as *const ())), Box_::into_raw(f))
603        }
604    }
605
606    #[doc(alias = "mru")]
607    pub fn connect_mru_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
608        unsafe extern "C" fn notify_mru_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
609            let f: &F = &*(f as *const F);
610            f(&from_glib_borrow(this))
611        }
612        unsafe {
613            let f: Box_<F> = Box_::new(f);
614            connect_raw(self.as_ptr() as *mut _, c"notify::mru".as_ptr() as *const _,
615                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_mru_trampoline::<F> as *const ())), Box_::into_raw(f))
616        }
617    }
618
619    #[doc(alias = "mtu")]
620    pub fn connect_mtu_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
621        unsafe extern "C" fn notify_mtu_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
622            let f: &F = &*(f as *const F);
623            f(&from_glib_borrow(this))
624        }
625        unsafe {
626            let f: Box_<F> = Box_::new(f);
627            connect_raw(self.as_ptr() as *mut _, c"notify::mtu".as_ptr() as *const _,
628                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_mtu_trampoline::<F> as *const ())), Box_::into_raw(f))
629        }
630    }
631
632    #[doc(alias = "no-vj-comp")]
633    pub fn connect_no_vj_comp_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
634        unsafe extern "C" fn notify_no_vj_comp_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
635            let f: &F = &*(f as *const F);
636            f(&from_glib_borrow(this))
637        }
638        unsafe {
639            let f: Box_<F> = Box_::new(f);
640            connect_raw(self.as_ptr() as *mut _, c"notify::no-vj-comp".as_ptr() as *const _,
641                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_no_vj_comp_trampoline::<F> as *const ())), Box_::into_raw(f))
642        }
643    }
644
645    #[doc(alias = "noauth")]
646    pub fn connect_noauth_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
647        unsafe extern "C" fn notify_noauth_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
648            let f: &F = &*(f as *const F);
649            f(&from_glib_borrow(this))
650        }
651        unsafe {
652            let f: Box_<F> = Box_::new(f);
653            connect_raw(self.as_ptr() as *mut _, c"notify::noauth".as_ptr() as *const _,
654                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_noauth_trampoline::<F> as *const ())), Box_::into_raw(f))
655        }
656    }
657
658    #[doc(alias = "nobsdcomp")]
659    pub fn connect_nobsdcomp_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
660        unsafe extern "C" fn notify_nobsdcomp_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
661            let f: &F = &*(f as *const F);
662            f(&from_glib_borrow(this))
663        }
664        unsafe {
665            let f: Box_<F> = Box_::new(f);
666            connect_raw(self.as_ptr() as *mut _, c"notify::nobsdcomp".as_ptr() as *const _,
667                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_nobsdcomp_trampoline::<F> as *const ())), Box_::into_raw(f))
668        }
669    }
670
671    #[doc(alias = "nodeflate")]
672    pub fn connect_nodeflate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
673        unsafe extern "C" fn notify_nodeflate_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
674            let f: &F = &*(f as *const F);
675            f(&from_glib_borrow(this))
676        }
677        unsafe {
678            let f: Box_<F> = Box_::new(f);
679            connect_raw(self.as_ptr() as *mut _, c"notify::nodeflate".as_ptr() as *const _,
680                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_nodeflate_trampoline::<F> as *const ())), Box_::into_raw(f))
681        }
682    }
683
684    #[doc(alias = "refuse-chap")]
685    pub fn connect_refuse_chap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
686        unsafe extern "C" fn notify_refuse_chap_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
687            let f: &F = &*(f as *const F);
688            f(&from_glib_borrow(this))
689        }
690        unsafe {
691            let f: Box_<F> = Box_::new(f);
692            connect_raw(self.as_ptr() as *mut _, c"notify::refuse-chap".as_ptr() as *const _,
693                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_refuse_chap_trampoline::<F> as *const ())), Box_::into_raw(f))
694        }
695    }
696
697    #[doc(alias = "refuse-eap")]
698    pub fn connect_refuse_eap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
699        unsafe extern "C" fn notify_refuse_eap_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
700            let f: &F = &*(f as *const F);
701            f(&from_glib_borrow(this))
702        }
703        unsafe {
704            let f: Box_<F> = Box_::new(f);
705            connect_raw(self.as_ptr() as *mut _, c"notify::refuse-eap".as_ptr() as *const _,
706                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_refuse_eap_trampoline::<F> as *const ())), Box_::into_raw(f))
707        }
708    }
709
710    #[doc(alias = "refuse-mschap")]
711    pub fn connect_refuse_mschap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
712        unsafe extern "C" fn notify_refuse_mschap_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
713            let f: &F = &*(f as *const F);
714            f(&from_glib_borrow(this))
715        }
716        unsafe {
717            let f: Box_<F> = Box_::new(f);
718            connect_raw(self.as_ptr() as *mut _, c"notify::refuse-mschap".as_ptr() as *const _,
719                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_refuse_mschap_trampoline::<F> as *const ())), Box_::into_raw(f))
720        }
721    }
722
723    #[doc(alias = "refuse-mschapv2")]
724    pub fn connect_refuse_mschapv2_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
725        unsafe extern "C" fn notify_refuse_mschapv2_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
726            let f: &F = &*(f as *const F);
727            f(&from_glib_borrow(this))
728        }
729        unsafe {
730            let f: Box_<F> = Box_::new(f);
731            connect_raw(self.as_ptr() as *mut _, c"notify::refuse-mschapv2".as_ptr() as *const _,
732                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_refuse_mschapv2_trampoline::<F> as *const ())), Box_::into_raw(f))
733        }
734    }
735
736    #[doc(alias = "refuse-pap")]
737    pub fn connect_refuse_pap_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
738        unsafe extern "C" fn notify_refuse_pap_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
739            let f: &F = &*(f as *const F);
740            f(&from_glib_borrow(this))
741        }
742        unsafe {
743            let f: Box_<F> = Box_::new(f);
744            connect_raw(self.as_ptr() as *mut _, c"notify::refuse-pap".as_ptr() as *const _,
745                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_refuse_pap_trampoline::<F> as *const ())), Box_::into_raw(f))
746        }
747    }
748
749    #[doc(alias = "require-mppe")]
750    pub fn connect_require_mppe_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
751        unsafe extern "C" fn notify_require_mppe_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
752            let f: &F = &*(f as *const F);
753            f(&from_glib_borrow(this))
754        }
755        unsafe {
756            let f: Box_<F> = Box_::new(f);
757            connect_raw(self.as_ptr() as *mut _, c"notify::require-mppe".as_ptr() as *const _,
758                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_require_mppe_trampoline::<F> as *const ())), Box_::into_raw(f))
759        }
760    }
761
762    #[doc(alias = "require-mppe-128")]
763    pub fn connect_require_mppe_128_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
764        unsafe extern "C" fn notify_require_mppe_128_trampoline<F: Fn(&SettingPpp) + 'static>(this: *mut ffi::NMSettingPpp, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
765            let f: &F = &*(f as *const F);
766            f(&from_glib_borrow(this))
767        }
768        unsafe {
769            let f: Box_<F> = Box_::new(f);
770            connect_raw(self.as_ptr() as *mut _, c"notify::require-mppe-128".as_ptr() as *const _,
771                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_require_mppe_128_trampoline::<F> as *const ())), Box_::into_raw(f))
772        }
773    }
774}
775
776impl Default for SettingPpp {
777                     fn default() -> Self {
778                         Self::new()
779                     }
780                 }
781
782// rustdoc-stripper-ignore-next
783        /// A [builder-pattern] type to construct [`SettingPpp`] objects.
784        ///
785        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
786#[must_use = "The builder must be built to be used"]
787pub struct SettingPppBuilder {
788            builder: glib::object::ObjectBuilder<'static, SettingPpp>,
789        }
790
791        impl SettingPppBuilder {
792        fn new() -> Self {
793            Self { builder: glib::object::Object::builder() }
794        }
795
796                            /// If non-zero, instruct pppd to set the serial port to the specified
797                            /// baudrate.  This value should normally be left as 0 to automatically
798                            /// choose the speed.
799                            pub fn baud(self, baud: u32) -> Self {
800                            Self { builder: self.builder.property("baud", baud), }
801                        }
802
803                            /// If [`true`], specify that pppd should set the serial port to use hardware
804                            /// flow control with RTS and CTS signals.  This value should normally be set
805                            /// to [`false`].
806                            pub fn crtscts(self, crtscts: bool) -> Self {
807                            Self { builder: self.builder.property("crtscts", crtscts), }
808                        }
809
810                            /// If non-zero, instruct pppd to presume the connection to the peer has
811                            /// failed if the specified number of LCP echo-requests go unanswered by the
812                            /// peer.  The "lcp-echo-interval" property must also be set to a non-zero
813                            /// value if this property is used.
814                            pub fn lcp_echo_failure(self, lcp_echo_failure: u32) -> Self {
815                            Self { builder: self.builder.property("lcp-echo-failure", lcp_echo_failure), }
816                        }
817
818                            /// If non-zero, instruct pppd to send an LCP echo-request frame to the peer
819                            /// every n seconds (where n is the specified value).  Note that some PPP
820                            /// peers will respond to echo requests and some will not, and it is not
821                            /// possible to autodetect this.
822                            pub fn lcp_echo_interval(self, lcp_echo_interval: u32) -> Self {
823                            Self { builder: self.builder.property("lcp-echo-interval", lcp_echo_interval), }
824                        }
825
826                            /// If [`true`], stateful MPPE is used.  See pppd documentation for more
827                            /// information on stateful MPPE.
828                            pub fn mppe_stateful(self, mppe_stateful: bool) -> Self {
829                            Self { builder: self.builder.property("mppe-stateful", mppe_stateful), }
830                        }
831
832                            /// If non-zero, instruct pppd to request that the peer send packets no
833                            /// larger than the specified size.  If non-zero, the MRU should be between
834                            /// 128 and 16384.
835                            pub fn mru(self, mru: u32) -> Self {
836                            Self { builder: self.builder.property("mru", mru), }
837                        }
838
839                            /// If non-zero, instruct pppd to send packets no larger than the specified
840                            /// size.
841                            pub fn mtu(self, mtu: u32) -> Self {
842                            Self { builder: self.builder.property("mtu", mtu), }
843                        }
844
845                            /// If [`true`], Van Jacobsen TCP header compression will not be requested.
846                            pub fn no_vj_comp(self, no_vj_comp: bool) -> Self {
847                            Self { builder: self.builder.property("no-vj-comp", no_vj_comp), }
848                        }
849
850                            /// If [`true`], do not require the other side (usually the PPP server) to
851                            /// authenticate itself to the client.  If [`false`], require authentication
852                            /// from the remote side.  In almost all cases, this should be [`true`].
853                            pub fn noauth(self, noauth: bool) -> Self {
854                            Self { builder: self.builder.property("noauth", noauth), }
855                        }
856
857                            /// If [`true`], BSD compression will not be requested.
858                            pub fn nobsdcomp(self, nobsdcomp: bool) -> Self {
859                            Self { builder: self.builder.property("nobsdcomp", nobsdcomp), }
860                        }
861
862                            /// If [`true`], "deflate" compression will not be requested.
863                            pub fn nodeflate(self, nodeflate: bool) -> Self {
864                            Self { builder: self.builder.property("nodeflate", nodeflate), }
865                        }
866
867                            /// If [`true`], the CHAP authentication method will not be used.
868                            pub fn refuse_chap(self, refuse_chap: bool) -> Self {
869                            Self { builder: self.builder.property("refuse-chap", refuse_chap), }
870                        }
871
872                            /// If [`true`], the EAP authentication method will not be used.
873                            pub fn refuse_eap(self, refuse_eap: bool) -> Self {
874                            Self { builder: self.builder.property("refuse-eap", refuse_eap), }
875                        }
876
877                            /// If [`true`], the MSCHAP authentication method will not be used.
878                            pub fn refuse_mschap(self, refuse_mschap: bool) -> Self {
879                            Self { builder: self.builder.property("refuse-mschap", refuse_mschap), }
880                        }
881
882                            /// If [`true`], the MSCHAPv2 authentication method will not be used.
883                            pub fn refuse_mschapv2(self, refuse_mschapv2: bool) -> Self {
884                            Self { builder: self.builder.property("refuse-mschapv2", refuse_mschapv2), }
885                        }
886
887                            /// If [`true`], the PAP authentication method will not be used.
888                            pub fn refuse_pap(self, refuse_pap: bool) -> Self {
889                            Self { builder: self.builder.property("refuse-pap", refuse_pap), }
890                        }
891
892                            /// If [`true`], MPPE (Microsoft Point-to-Point Encryption) will be required for
893                            /// the PPP session.  If either 64-bit or 128-bit MPPE is not available the
894                            /// session will fail.  Note that MPPE is not used on mobile broadband
895                            /// connections.
896                            pub fn require_mppe(self, require_mppe: bool) -> Self {
897                            Self { builder: self.builder.property("require-mppe", require_mppe), }
898                        }
899
900                            /// If [`true`], 128-bit MPPE (Microsoft Point-to-Point Encryption) will be
901                            /// required for the PPP session, and the "require-mppe" property must also
902                            /// be set to [`true`].  If 128-bit MPPE is not available the session will fail.
903                            pub fn require_mppe_128(self, require_mppe_128: bool) -> Self {
904                            Self { builder: self.builder.property("require-mppe-128", require_mppe_128), }
905                        }
906
907    // rustdoc-stripper-ignore-next
908    /// Build the [`SettingPpp`].
909    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
910    pub fn build(self) -> SettingPpp {
911assert_initialized_main_thread!();
912    self.builder.build() }
913}