abol_codegen/
rfc2865.rs

1use abol_core::packet::Packet;
2use std::net::Ipv4Addr;
3
4pub const USER_NAME_TYPE: u8 = 1u8;
5pub const USER_PASSWORD_TYPE: u8 = 2u8;
6pub const CHAP_PASSWORD_TYPE: u8 = 3u8;
7pub const NAS_IP_ADDRESS_TYPE: u8 = 4u8;
8pub const NAS_PORT_TYPE: u8 = 5u8;
9pub const SERVICE_TYPE_TYPE: u8 = 6u8;
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11#[repr(u32)]
12pub enum ServiceType {
13    LoginUser,
14    FramedUser,
15    CallbackLoginUser,
16    CallbackFramedUser,
17    OutboundUser,
18    AdministrativeUser,
19    NasPromptUser,
20    AuthenticateOnly,
21    CallbackNasPrompt,
22    CallCheck,
23    CallbackAdministrative,
24    Unknown(u32),
25}
26impl From<u32> for ServiceType {
27    fn from(v: u32) -> Self {
28        match v {
29            1u32 => Self::LoginUser,
30            2u32 => Self::FramedUser,
31            3u32 => Self::CallbackLoginUser,
32            4u32 => Self::CallbackFramedUser,
33            5u32 => Self::OutboundUser,
34            6u32 => Self::AdministrativeUser,
35            7u32 => Self::NasPromptUser,
36            8u32 => Self::AuthenticateOnly,
37            9u32 => Self::CallbackNasPrompt,
38            10u32 => Self::CallCheck,
39            11u32 => Self::CallbackAdministrative,
40            other => Self::Unknown(other),
41        }
42    }
43}
44impl From<ServiceType> for u32 {
45    fn from(e: ServiceType) -> Self {
46        match e {
47            ServiceType::LoginUser => 1u32,
48            ServiceType::FramedUser => 2u32,
49            ServiceType::CallbackLoginUser => 3u32,
50            ServiceType::CallbackFramedUser => 4u32,
51            ServiceType::OutboundUser => 5u32,
52            ServiceType::AdministrativeUser => 6u32,
53            ServiceType::NasPromptUser => 7u32,
54            ServiceType::AuthenticateOnly => 8u32,
55            ServiceType::CallbackNasPrompt => 9u32,
56            ServiceType::CallCheck => 10u32,
57            ServiceType::CallbackAdministrative => 11u32,
58            ServiceType::Unknown(v) => v,
59        }
60    }
61}
62pub const FRAMED_PROTOCOL_TYPE: u8 = 7u8;
63#[derive(Debug, Clone, Copy, PartialEq, Eq)]
64#[repr(u32)]
65pub enum FramedProtocol {
66    Ppp,
67    Slip,
68    Arap,
69    GandalfSlml,
70    XylogicsIpxSlip,
71    X75Synchronous,
72    Unknown(u32),
73}
74impl From<u32> for FramedProtocol {
75    fn from(v: u32) -> Self {
76        match v {
77            1u32 => Self::Ppp,
78            2u32 => Self::Slip,
79            3u32 => Self::Arap,
80            4u32 => Self::GandalfSlml,
81            5u32 => Self::XylogicsIpxSlip,
82            6u32 => Self::X75Synchronous,
83            other => Self::Unknown(other),
84        }
85    }
86}
87impl From<FramedProtocol> for u32 {
88    fn from(e: FramedProtocol) -> Self {
89        match e {
90            FramedProtocol::Ppp => 1u32,
91            FramedProtocol::Slip => 2u32,
92            FramedProtocol::Arap => 3u32,
93            FramedProtocol::GandalfSlml => 4u32,
94            FramedProtocol::XylogicsIpxSlip => 5u32,
95            FramedProtocol::X75Synchronous => 6u32,
96            FramedProtocol::Unknown(v) => v,
97        }
98    }
99}
100pub const FRAMED_IP_ADDRESS_TYPE: u8 = 8u8;
101pub const FRAMED_IP_NETMASK_TYPE: u8 = 9u8;
102pub const FRAMED_ROUTING_TYPE: u8 = 10u8;
103#[derive(Debug, Clone, Copy, PartialEq, Eq)]
104#[repr(u32)]
105pub enum FramedRouting {
106    None,
107    Broadcast,
108    Listen,
109    BroadcastListen,
110    Unknown(u32),
111}
112impl From<u32> for FramedRouting {
113    fn from(v: u32) -> Self {
114        match v {
115            0u32 => Self::None,
116            1u32 => Self::Broadcast,
117            2u32 => Self::Listen,
118            3u32 => Self::BroadcastListen,
119            other => Self::Unknown(other),
120        }
121    }
122}
123impl From<FramedRouting> for u32 {
124    fn from(e: FramedRouting) -> Self {
125        match e {
126            FramedRouting::None => 0u32,
127            FramedRouting::Broadcast => 1u32,
128            FramedRouting::Listen => 2u32,
129            FramedRouting::BroadcastListen => 3u32,
130            FramedRouting::Unknown(v) => v,
131        }
132    }
133}
134pub const FILTER_ID_TYPE: u8 = 11u8;
135pub const FRAMED_MTU_TYPE: u8 = 12u8;
136pub const FRAMED_COMPRESSION_TYPE: u8 = 13u8;
137#[derive(Debug, Clone, Copy, PartialEq, Eq)]
138#[repr(u32)]
139pub enum FramedCompression {
140    None,
141    VanJacobsonTcpIp,
142    IpxHeaderCompression,
143    StacLzs,
144    Unknown(u32),
145}
146impl From<u32> for FramedCompression {
147    fn from(v: u32) -> Self {
148        match v {
149            0u32 => Self::None,
150            1u32 => Self::VanJacobsonTcpIp,
151            2u32 => Self::IpxHeaderCompression,
152            3u32 => Self::StacLzs,
153            other => Self::Unknown(other),
154        }
155    }
156}
157impl From<FramedCompression> for u32 {
158    fn from(e: FramedCompression) -> Self {
159        match e {
160            FramedCompression::None => 0u32,
161            FramedCompression::VanJacobsonTcpIp => 1u32,
162            FramedCompression::IpxHeaderCompression => 2u32,
163            FramedCompression::StacLzs => 3u32,
164            FramedCompression::Unknown(v) => v,
165        }
166    }
167}
168pub const LOGIN_IP_HOST_TYPE: u8 = 14u8;
169pub const LOGIN_SERVICE_TYPE: u8 = 15u8;
170#[derive(Debug, Clone, Copy, PartialEq, Eq)]
171#[repr(u32)]
172pub enum LoginService {
173    Telnet,
174    Rlogin,
175    TcpClear,
176    PortMaster,
177    Lat,
178    X25Pad,
179    X25T3pos,
180    TcpClearQuiet,
181    Unknown(u32),
182}
183impl From<u32> for LoginService {
184    fn from(v: u32) -> Self {
185        match v {
186            0u32 => Self::Telnet,
187            1u32 => Self::Rlogin,
188            2u32 => Self::TcpClear,
189            3u32 => Self::PortMaster,
190            4u32 => Self::Lat,
191            5u32 => Self::X25Pad,
192            6u32 => Self::X25T3pos,
193            8u32 => Self::TcpClearQuiet,
194            other => Self::Unknown(other),
195        }
196    }
197}
198impl From<LoginService> for u32 {
199    fn from(e: LoginService) -> Self {
200        match e {
201            LoginService::Telnet => 0u32,
202            LoginService::Rlogin => 1u32,
203            LoginService::TcpClear => 2u32,
204            LoginService::PortMaster => 3u32,
205            LoginService::Lat => 4u32,
206            LoginService::X25Pad => 5u32,
207            LoginService::X25T3pos => 6u32,
208            LoginService::TcpClearQuiet => 8u32,
209            LoginService::Unknown(v) => v,
210        }
211    }
212}
213pub const LOGIN_TCP_PORT_TYPE: u8 = 16u8;
214#[derive(Debug, Clone, Copy, PartialEq, Eq)]
215#[repr(u32)]
216pub enum LoginTcpPort {
217    Telnet,
218    Rlogin,
219    Rsh,
220    Unknown(u32),
221}
222impl From<u32> for LoginTcpPort {
223    fn from(v: u32) -> Self {
224        match v {
225            23u32 => Self::Telnet,
226            513u32 => Self::Rlogin,
227            514u32 => Self::Rsh,
228            other => Self::Unknown(other),
229        }
230    }
231}
232impl From<LoginTcpPort> for u32 {
233    fn from(e: LoginTcpPort) -> Self {
234        match e {
235            LoginTcpPort::Telnet => 23u32,
236            LoginTcpPort::Rlogin => 513u32,
237            LoginTcpPort::Rsh => 514u32,
238            LoginTcpPort::Unknown(v) => v,
239        }
240    }
241}
242pub const REPLY_MESSAGE_TYPE: u8 = 18u8;
243pub const CALLBACK_NUMBER_TYPE: u8 = 19u8;
244pub const CALLBACK_ID_TYPE: u8 = 20u8;
245pub const FRAMED_ROUTE_TYPE: u8 = 22u8;
246pub const FRAMED_IPX_NETWORK_TYPE: u8 = 23u8;
247pub const STATE_TYPE: u8 = 24u8;
248pub const CLASS_TYPE: u8 = 25u8;
249pub const VENDOR_SPECIFIC_TYPE: u8 = 26u8;
250pub const SESSION_TIMEOUT_TYPE: u8 = 27u8;
251pub const IDLE_TIMEOUT_TYPE: u8 = 28u8;
252pub const TERMINATION_ACTION_TYPE: u8 = 29u8;
253#[derive(Debug, Clone, Copy, PartialEq, Eq)]
254#[repr(u32)]
255pub enum TerminationAction {
256    Default,
257    RadiusRequest,
258    Unknown(u32),
259}
260impl From<u32> for TerminationAction {
261    fn from(v: u32) -> Self {
262        match v {
263            0u32 => Self::Default,
264            1u32 => Self::RadiusRequest,
265            other => Self::Unknown(other),
266        }
267    }
268}
269impl From<TerminationAction> for u32 {
270    fn from(e: TerminationAction) -> Self {
271        match e {
272            TerminationAction::Default => 0u32,
273            TerminationAction::RadiusRequest => 1u32,
274            TerminationAction::Unknown(v) => v,
275        }
276    }
277}
278pub const CALLED_STATION_ID_TYPE: u8 = 30u8;
279pub const CALLING_STATION_ID_TYPE: u8 = 31u8;
280pub const NAS_IDENTIFIER_TYPE: u8 = 32u8;
281pub const PROXY_STATE_TYPE: u8 = 33u8;
282pub const LOGIN_LAT_SERVICE_TYPE: u8 = 34u8;
283pub const LOGIN_LAT_NODE_TYPE: u8 = 35u8;
284pub const LOGIN_LAT_GROUP_TYPE: u8 = 36u8;
285pub const FRAMED_APPLETALK_LINK_TYPE: u8 = 37u8;
286pub const FRAMED_APPLETALK_NETWORK_TYPE: u8 = 38u8;
287pub const FRAMED_APPLETALK_ZONE_TYPE: u8 = 39u8;
288pub const CHAP_CHALLENGE_TYPE: u8 = 60u8;
289pub const NAS_PORT_TYPE_TYPE: u8 = 61u8;
290#[derive(Debug, Clone, Copy, PartialEq, Eq)]
291#[repr(u32)]
292pub enum NasPortType {
293    Async,
294    Sync,
295    Isdn,
296    IsdnV120,
297    IsdnV110,
298    Virtual,
299    Piafs,
300    HdlcClearChannel,
301    X25,
302    X75,
303    G3Fax,
304    Sdsl,
305    AdslCap,
306    AdslDmt,
307    Idsl,
308    Ethernet,
309    XDsl,
310    Cable,
311    WirelessOther,
312    Wireless80211,
313    Unknown(u32),
314}
315impl From<u32> for NasPortType {
316    fn from(v: u32) -> Self {
317        match v {
318            0u32 => Self::Async,
319            1u32 => Self::Sync,
320            2u32 => Self::Isdn,
321            3u32 => Self::IsdnV120,
322            4u32 => Self::IsdnV110,
323            5u32 => Self::Virtual,
324            6u32 => Self::Piafs,
325            7u32 => Self::HdlcClearChannel,
326            8u32 => Self::X25,
327            9u32 => Self::X75,
328            10u32 => Self::G3Fax,
329            11u32 => Self::Sdsl,
330            12u32 => Self::AdslCap,
331            13u32 => Self::AdslDmt,
332            14u32 => Self::Idsl,
333            15u32 => Self::Ethernet,
334            16u32 => Self::XDsl,
335            17u32 => Self::Cable,
336            18u32 => Self::WirelessOther,
337            19u32 => Self::Wireless80211,
338            other => Self::Unknown(other),
339        }
340    }
341}
342impl From<NasPortType> for u32 {
343    fn from(e: NasPortType) -> Self {
344        match e {
345            NasPortType::Async => 0u32,
346            NasPortType::Sync => 1u32,
347            NasPortType::Isdn => 2u32,
348            NasPortType::IsdnV120 => 3u32,
349            NasPortType::IsdnV110 => 4u32,
350            NasPortType::Virtual => 5u32,
351            NasPortType::Piafs => 6u32,
352            NasPortType::HdlcClearChannel => 7u32,
353            NasPortType::X25 => 8u32,
354            NasPortType::X75 => 9u32,
355            NasPortType::G3Fax => 10u32,
356            NasPortType::Sdsl => 11u32,
357            NasPortType::AdslCap => 12u32,
358            NasPortType::AdslDmt => 13u32,
359            NasPortType::Idsl => 14u32,
360            NasPortType::Ethernet => 15u32,
361            NasPortType::XDsl => 16u32,
362            NasPortType::Cable => 17u32,
363            NasPortType::WirelessOther => 18u32,
364            NasPortType::Wireless80211 => 19u32,
365            NasPortType::Unknown(v) => v,
366        }
367    }
368}
369pub const PORT_LIMIT_TYPE: u8 = 62u8;
370pub const LOGIN_LAT_PORT_TYPE: u8 = 63u8;
371pub trait Rfc2865Ext {
372    fn get_user_name(&self) -> Option<String>;
373    fn set_user_name(&mut self, value: impl Into<String>);
374    fn get_user_password(&self) -> Option<String>;
375    fn set_user_password(&mut self, value: impl Into<String>);
376    fn get_chap_password(&self) -> Option<Vec<u8>>;
377    fn set_chap_password(&mut self, value: impl Into<Vec<u8>>);
378    fn get_nas_ip_address(&self) -> Option<Ipv4Addr>;
379    fn set_nas_ip_address(&mut self, value: Ipv4Addr);
380    fn get_nas_port(&self) -> Option<u32>;
381    fn set_nas_port(&mut self, value: u32);
382    fn get_service_type(&self) -> Option<ServiceType>;
383    fn set_service_type(&mut self, value: ServiceType);
384    fn get_framed_protocol(&self) -> Option<FramedProtocol>;
385    fn set_framed_protocol(&mut self, value: FramedProtocol);
386    fn get_framed_ip_address(&self) -> Option<Ipv4Addr>;
387    fn set_framed_ip_address(&mut self, value: Ipv4Addr);
388    fn get_framed_ip_netmask(&self) -> Option<Ipv4Addr>;
389    fn set_framed_ip_netmask(&mut self, value: Ipv4Addr);
390    fn get_framed_routing(&self) -> Option<FramedRouting>;
391    fn set_framed_routing(&mut self, value: FramedRouting);
392    fn get_filter_id(&self) -> Option<String>;
393    fn set_filter_id(&mut self, value: impl Into<String>);
394    fn get_framed_mtu(&self) -> Option<u32>;
395    fn set_framed_mtu(&mut self, value: u32);
396    fn get_framed_compression(&self) -> Option<FramedCompression>;
397    fn set_framed_compression(&mut self, value: FramedCompression);
398    fn get_login_ip_host(&self) -> Option<Ipv4Addr>;
399    fn set_login_ip_host(&mut self, value: Ipv4Addr);
400    fn get_login_service(&self) -> Option<LoginService>;
401    fn set_login_service(&mut self, value: LoginService);
402    fn get_login_tcp_port(&self) -> Option<LoginTcpPort>;
403    fn set_login_tcp_port(&mut self, value: LoginTcpPort);
404    fn get_reply_message(&self) -> Option<String>;
405    fn set_reply_message(&mut self, value: impl Into<String>);
406    fn get_callback_number(&self) -> Option<String>;
407    fn set_callback_number(&mut self, value: impl Into<String>);
408    fn get_callback_id(&self) -> Option<String>;
409    fn set_callback_id(&mut self, value: impl Into<String>);
410    fn get_framed_route(&self) -> Option<String>;
411    fn set_framed_route(&mut self, value: impl Into<String>);
412    fn get_framed_ipx_network(&self) -> Option<Ipv4Addr>;
413    fn set_framed_ipx_network(&mut self, value: Ipv4Addr);
414    fn get_state(&self) -> Option<Vec<u8>>;
415    fn set_state(&mut self, value: impl Into<Vec<u8>>);
416    fn get_class(&self) -> Option<Vec<u8>>;
417    fn set_class(&mut self, value: impl Into<Vec<u8>>);
418    fn get_vendor_specific(&self) -> Option<Vec<u8>>;
419    fn set_vendor_specific(&mut self, value: impl Into<Vec<u8>>);
420    fn get_session_timeout(&self) -> Option<u32>;
421    fn set_session_timeout(&mut self, value: u32);
422    fn get_idle_timeout(&self) -> Option<u32>;
423    fn set_idle_timeout(&mut self, value: u32);
424    fn get_termination_action(&self) -> Option<TerminationAction>;
425    fn set_termination_action(&mut self, value: TerminationAction);
426    fn get_called_station_id(&self) -> Option<String>;
427    fn set_called_station_id(&mut self, value: impl Into<String>);
428    fn get_calling_station_id(&self) -> Option<String>;
429    fn set_calling_station_id(&mut self, value: impl Into<String>);
430    fn get_nas_identifier(&self) -> Option<String>;
431    fn set_nas_identifier(&mut self, value: impl Into<String>);
432    fn get_proxy_state(&self) -> Option<Vec<u8>>;
433    fn set_proxy_state(&mut self, value: impl Into<Vec<u8>>);
434    fn get_login_lat_service(&self) -> Option<String>;
435    fn set_login_lat_service(&mut self, value: impl Into<String>);
436    fn get_login_lat_node(&self) -> Option<String>;
437    fn set_login_lat_node(&mut self, value: impl Into<String>);
438    fn get_login_lat_group(&self) -> Option<Vec<u8>>;
439    fn set_login_lat_group(&mut self, value: impl Into<Vec<u8>>);
440    fn get_framed_appletalk_link(&self) -> Option<u32>;
441    fn set_framed_appletalk_link(&mut self, value: u32);
442    fn get_framed_appletalk_network(&self) -> Option<u32>;
443    fn set_framed_appletalk_network(&mut self, value: u32);
444    fn get_framed_appletalk_zone(&self) -> Option<String>;
445    fn set_framed_appletalk_zone(&mut self, value: impl Into<String>);
446    fn get_chap_challenge(&self) -> Option<Vec<u8>>;
447    fn set_chap_challenge(&mut self, value: impl Into<Vec<u8>>);
448    fn get_nas_port_type(&self) -> Option<NasPortType>;
449    fn set_nas_port_type(&mut self, value: NasPortType);
450    fn get_port_limit(&self) -> Option<u32>;
451    fn set_port_limit(&mut self, value: u32);
452    fn get_login_lat_port(&self) -> Option<String>;
453    fn set_login_lat_port(&mut self, value: impl Into<String>);
454}
455impl Rfc2865Ext for Packet {
456    fn get_user_name(&self) -> Option<String> {
457        self.get_attribute_as::<String>(USER_NAME_TYPE)
458    }
459    fn set_user_name(&mut self, value: impl Into<String>) {
460        let wire_val: String = value.into();
461        self.set_attribute_as::<String>(USER_NAME_TYPE, wire_val);
462    }
463    fn get_user_password(&self) -> Option<String> {
464        self.get_attribute_as::<String>(USER_PASSWORD_TYPE)
465    }
466    fn set_user_password(&mut self, value: impl Into<String>) {
467        let wire_val: String = value.into();
468        self.set_attribute_as::<String>(USER_PASSWORD_TYPE, wire_val);
469    }
470    fn get_chap_password(&self) -> Option<Vec<u8>> {
471        self.get_attribute_as::<Vec<u8>>(CHAP_PASSWORD_TYPE)
472    }
473    fn set_chap_password(&mut self, value: impl Into<Vec<u8>>) {
474        let wire_val: Vec<u8> = value.into();
475        self.set_attribute_as::<Vec<u8>>(CHAP_PASSWORD_TYPE, wire_val);
476    }
477    fn get_nas_ip_address(&self) -> Option<Ipv4Addr> {
478        self.get_attribute_as::<Ipv4Addr>(NAS_IP_ADDRESS_TYPE)
479    }
480    fn set_nas_ip_address(&mut self, value: Ipv4Addr) {
481        let wire_val = value;
482        self.set_attribute_as::<Ipv4Addr>(NAS_IP_ADDRESS_TYPE, wire_val);
483    }
484    fn get_nas_port(&self) -> Option<u32> {
485        self.get_attribute_as::<u32>(NAS_PORT_TYPE)
486    }
487    fn set_nas_port(&mut self, value: u32) {
488        let wire_val = value;
489        self.set_attribute_as::<u32>(NAS_PORT_TYPE, wire_val);
490    }
491    fn get_service_type(&self) -> Option<ServiceType> {
492        self.get_attribute_as::<u32>(SERVICE_TYPE_TYPE)
493            .map(ServiceType::from)
494    }
495    fn set_service_type(&mut self, value: ServiceType) {
496        let wire_val: u32 = value.into();
497        self.set_attribute_as::<u32>(SERVICE_TYPE_TYPE, wire_val);
498    }
499    fn get_framed_protocol(&self) -> Option<FramedProtocol> {
500        self.get_attribute_as::<u32>(FRAMED_PROTOCOL_TYPE)
501            .map(FramedProtocol::from)
502    }
503    fn set_framed_protocol(&mut self, value: FramedProtocol) {
504        let wire_val: u32 = value.into();
505        self.set_attribute_as::<u32>(FRAMED_PROTOCOL_TYPE, wire_val);
506    }
507    fn get_framed_ip_address(&self) -> Option<Ipv4Addr> {
508        self.get_attribute_as::<Ipv4Addr>(FRAMED_IP_ADDRESS_TYPE)
509    }
510    fn set_framed_ip_address(&mut self, value: Ipv4Addr) {
511        let wire_val = value;
512        self.set_attribute_as::<Ipv4Addr>(FRAMED_IP_ADDRESS_TYPE, wire_val);
513    }
514    fn get_framed_ip_netmask(&self) -> Option<Ipv4Addr> {
515        self.get_attribute_as::<Ipv4Addr>(FRAMED_IP_NETMASK_TYPE)
516    }
517    fn set_framed_ip_netmask(&mut self, value: Ipv4Addr) {
518        let wire_val = value;
519        self.set_attribute_as::<Ipv4Addr>(FRAMED_IP_NETMASK_TYPE, wire_val);
520    }
521    fn get_framed_routing(&self) -> Option<FramedRouting> {
522        self.get_attribute_as::<u32>(FRAMED_ROUTING_TYPE)
523            .map(FramedRouting::from)
524    }
525    fn set_framed_routing(&mut self, value: FramedRouting) {
526        let wire_val: u32 = value.into();
527        self.set_attribute_as::<u32>(FRAMED_ROUTING_TYPE, wire_val);
528    }
529    fn get_filter_id(&self) -> Option<String> {
530        self.get_attribute_as::<String>(FILTER_ID_TYPE)
531    }
532    fn set_filter_id(&mut self, value: impl Into<String>) {
533        let wire_val: String = value.into();
534        self.set_attribute_as::<String>(FILTER_ID_TYPE, wire_val);
535    }
536    fn get_framed_mtu(&self) -> Option<u32> {
537        self.get_attribute_as::<u32>(FRAMED_MTU_TYPE)
538    }
539    fn set_framed_mtu(&mut self, value: u32) {
540        let wire_val = value;
541        self.set_attribute_as::<u32>(FRAMED_MTU_TYPE, wire_val);
542    }
543    fn get_framed_compression(&self) -> Option<FramedCompression> {
544        self.get_attribute_as::<u32>(FRAMED_COMPRESSION_TYPE)
545            .map(FramedCompression::from)
546    }
547    fn set_framed_compression(&mut self, value: FramedCompression) {
548        let wire_val: u32 = value.into();
549        self.set_attribute_as::<u32>(FRAMED_COMPRESSION_TYPE, wire_val);
550    }
551    fn get_login_ip_host(&self) -> Option<Ipv4Addr> {
552        self.get_attribute_as::<Ipv4Addr>(LOGIN_IP_HOST_TYPE)
553    }
554    fn set_login_ip_host(&mut self, value: Ipv4Addr) {
555        let wire_val = value;
556        self.set_attribute_as::<Ipv4Addr>(LOGIN_IP_HOST_TYPE, wire_val);
557    }
558    fn get_login_service(&self) -> Option<LoginService> {
559        self.get_attribute_as::<u32>(LOGIN_SERVICE_TYPE)
560            .map(LoginService::from)
561    }
562    fn set_login_service(&mut self, value: LoginService) {
563        let wire_val: u32 = value.into();
564        self.set_attribute_as::<u32>(LOGIN_SERVICE_TYPE, wire_val);
565    }
566    fn get_login_tcp_port(&self) -> Option<LoginTcpPort> {
567        self.get_attribute_as::<u32>(LOGIN_TCP_PORT_TYPE)
568            .map(LoginTcpPort::from)
569    }
570    fn set_login_tcp_port(&mut self, value: LoginTcpPort) {
571        let wire_val: u32 = value.into();
572        self.set_attribute_as::<u32>(LOGIN_TCP_PORT_TYPE, wire_val);
573    }
574    fn get_reply_message(&self) -> Option<String> {
575        self.get_attribute_as::<String>(REPLY_MESSAGE_TYPE)
576    }
577    fn set_reply_message(&mut self, value: impl Into<String>) {
578        let wire_val: String = value.into();
579        self.set_attribute_as::<String>(REPLY_MESSAGE_TYPE, wire_val);
580    }
581    fn get_callback_number(&self) -> Option<String> {
582        self.get_attribute_as::<String>(CALLBACK_NUMBER_TYPE)
583    }
584    fn set_callback_number(&mut self, value: impl Into<String>) {
585        let wire_val: String = value.into();
586        self.set_attribute_as::<String>(CALLBACK_NUMBER_TYPE, wire_val);
587    }
588    fn get_callback_id(&self) -> Option<String> {
589        self.get_attribute_as::<String>(CALLBACK_ID_TYPE)
590    }
591    fn set_callback_id(&mut self, value: impl Into<String>) {
592        let wire_val: String = value.into();
593        self.set_attribute_as::<String>(CALLBACK_ID_TYPE, wire_val);
594    }
595    fn get_framed_route(&self) -> Option<String> {
596        self.get_attribute_as::<String>(FRAMED_ROUTE_TYPE)
597    }
598    fn set_framed_route(&mut self, value: impl Into<String>) {
599        let wire_val: String = value.into();
600        self.set_attribute_as::<String>(FRAMED_ROUTE_TYPE, wire_val);
601    }
602    fn get_framed_ipx_network(&self) -> Option<Ipv4Addr> {
603        self.get_attribute_as::<Ipv4Addr>(FRAMED_IPX_NETWORK_TYPE)
604    }
605    fn set_framed_ipx_network(&mut self, value: Ipv4Addr) {
606        let wire_val = value;
607        self.set_attribute_as::<Ipv4Addr>(FRAMED_IPX_NETWORK_TYPE, wire_val);
608    }
609    fn get_state(&self) -> Option<Vec<u8>> {
610        self.get_attribute_as::<Vec<u8>>(STATE_TYPE)
611    }
612    fn set_state(&mut self, value: impl Into<Vec<u8>>) {
613        let wire_val: Vec<u8> = value.into();
614        self.set_attribute_as::<Vec<u8>>(STATE_TYPE, wire_val);
615    }
616    fn get_class(&self) -> Option<Vec<u8>> {
617        self.get_attribute_as::<Vec<u8>>(CLASS_TYPE)
618    }
619    fn set_class(&mut self, value: impl Into<Vec<u8>>) {
620        let wire_val: Vec<u8> = value.into();
621        self.set_attribute_as::<Vec<u8>>(CLASS_TYPE, wire_val);
622    }
623    fn get_vendor_specific(&self) -> Option<Vec<u8>> {
624        self.get_attribute_as::<Vec<u8>>(VENDOR_SPECIFIC_TYPE)
625    }
626    fn set_vendor_specific(&mut self, value: impl Into<Vec<u8>>) {
627        let wire_val: Vec<u8> = value.into();
628        self.set_attribute_as::<Vec<u8>>(VENDOR_SPECIFIC_TYPE, wire_val);
629    }
630    fn get_session_timeout(&self) -> Option<u32> {
631        self.get_attribute_as::<u32>(SESSION_TIMEOUT_TYPE)
632    }
633    fn set_session_timeout(&mut self, value: u32) {
634        let wire_val = value;
635        self.set_attribute_as::<u32>(SESSION_TIMEOUT_TYPE, wire_val);
636    }
637    fn get_idle_timeout(&self) -> Option<u32> {
638        self.get_attribute_as::<u32>(IDLE_TIMEOUT_TYPE)
639    }
640    fn set_idle_timeout(&mut self, value: u32) {
641        let wire_val = value;
642        self.set_attribute_as::<u32>(IDLE_TIMEOUT_TYPE, wire_val);
643    }
644    fn get_termination_action(&self) -> Option<TerminationAction> {
645        self.get_attribute_as::<u32>(TERMINATION_ACTION_TYPE)
646            .map(TerminationAction::from)
647    }
648    fn set_termination_action(&mut self, value: TerminationAction) {
649        let wire_val: u32 = value.into();
650        self.set_attribute_as::<u32>(TERMINATION_ACTION_TYPE, wire_val);
651    }
652    fn get_called_station_id(&self) -> Option<String> {
653        self.get_attribute_as::<String>(CALLED_STATION_ID_TYPE)
654    }
655    fn set_called_station_id(&mut self, value: impl Into<String>) {
656        let wire_val: String = value.into();
657        self.set_attribute_as::<String>(CALLED_STATION_ID_TYPE, wire_val);
658    }
659    fn get_calling_station_id(&self) -> Option<String> {
660        self.get_attribute_as::<String>(CALLING_STATION_ID_TYPE)
661    }
662    fn set_calling_station_id(&mut self, value: impl Into<String>) {
663        let wire_val: String = value.into();
664        self.set_attribute_as::<String>(CALLING_STATION_ID_TYPE, wire_val);
665    }
666    fn get_nas_identifier(&self) -> Option<String> {
667        self.get_attribute_as::<String>(NAS_IDENTIFIER_TYPE)
668    }
669    fn set_nas_identifier(&mut self, value: impl Into<String>) {
670        let wire_val: String = value.into();
671        self.set_attribute_as::<String>(NAS_IDENTIFIER_TYPE, wire_val);
672    }
673    fn get_proxy_state(&self) -> Option<Vec<u8>> {
674        self.get_attribute_as::<Vec<u8>>(PROXY_STATE_TYPE)
675    }
676    fn set_proxy_state(&mut self, value: impl Into<Vec<u8>>) {
677        let wire_val: Vec<u8> = value.into();
678        self.set_attribute_as::<Vec<u8>>(PROXY_STATE_TYPE, wire_val);
679    }
680    fn get_login_lat_service(&self) -> Option<String> {
681        self.get_attribute_as::<String>(LOGIN_LAT_SERVICE_TYPE)
682    }
683    fn set_login_lat_service(&mut self, value: impl Into<String>) {
684        let wire_val: String = value.into();
685        self.set_attribute_as::<String>(LOGIN_LAT_SERVICE_TYPE, wire_val);
686    }
687    fn get_login_lat_node(&self) -> Option<String> {
688        self.get_attribute_as::<String>(LOGIN_LAT_NODE_TYPE)
689    }
690    fn set_login_lat_node(&mut self, value: impl Into<String>) {
691        let wire_val: String = value.into();
692        self.set_attribute_as::<String>(LOGIN_LAT_NODE_TYPE, wire_val);
693    }
694    fn get_login_lat_group(&self) -> Option<Vec<u8>> {
695        self.get_attribute_as::<Vec<u8>>(LOGIN_LAT_GROUP_TYPE)
696    }
697    fn set_login_lat_group(&mut self, value: impl Into<Vec<u8>>) {
698        let wire_val: Vec<u8> = value.into();
699        self.set_attribute_as::<Vec<u8>>(LOGIN_LAT_GROUP_TYPE, wire_val);
700    }
701    fn get_framed_appletalk_link(&self) -> Option<u32> {
702        self.get_attribute_as::<u32>(FRAMED_APPLETALK_LINK_TYPE)
703    }
704    fn set_framed_appletalk_link(&mut self, value: u32) {
705        let wire_val = value;
706        self.set_attribute_as::<u32>(FRAMED_APPLETALK_LINK_TYPE, wire_val);
707    }
708    fn get_framed_appletalk_network(&self) -> Option<u32> {
709        self.get_attribute_as::<u32>(FRAMED_APPLETALK_NETWORK_TYPE)
710    }
711    fn set_framed_appletalk_network(&mut self, value: u32) {
712        let wire_val = value;
713        self.set_attribute_as::<u32>(FRAMED_APPLETALK_NETWORK_TYPE, wire_val);
714    }
715    fn get_framed_appletalk_zone(&self) -> Option<String> {
716        self.get_attribute_as::<String>(FRAMED_APPLETALK_ZONE_TYPE)
717    }
718    fn set_framed_appletalk_zone(&mut self, value: impl Into<String>) {
719        let wire_val: String = value.into();
720        self.set_attribute_as::<String>(FRAMED_APPLETALK_ZONE_TYPE, wire_val);
721    }
722    fn get_chap_challenge(&self) -> Option<Vec<u8>> {
723        self.get_attribute_as::<Vec<u8>>(CHAP_CHALLENGE_TYPE)
724    }
725    fn set_chap_challenge(&mut self, value: impl Into<Vec<u8>>) {
726        let wire_val: Vec<u8> = value.into();
727        self.set_attribute_as::<Vec<u8>>(CHAP_CHALLENGE_TYPE, wire_val);
728    }
729    fn get_nas_port_type(&self) -> Option<NasPortType> {
730        self.get_attribute_as::<u32>(NAS_PORT_TYPE_TYPE)
731            .map(NasPortType::from)
732    }
733    fn set_nas_port_type(&mut self, value: NasPortType) {
734        let wire_val: u32 = value.into();
735        self.set_attribute_as::<u32>(NAS_PORT_TYPE_TYPE, wire_val);
736    }
737    fn get_port_limit(&self) -> Option<u32> {
738        self.get_attribute_as::<u32>(PORT_LIMIT_TYPE)
739    }
740    fn set_port_limit(&mut self, value: u32) {
741        let wire_val = value;
742        self.set_attribute_as::<u32>(PORT_LIMIT_TYPE, wire_val);
743    }
744    fn get_login_lat_port(&self) -> Option<String> {
745        self.get_attribute_as::<String>(LOGIN_LAT_PORT_TYPE)
746    }
747    fn set_login_lat_port(&mut self, value: impl Into<String>) {
748        let wire_val: String = value.into();
749        self.set_attribute_as::<String>(LOGIN_LAT_PORT_TYPE, wire_val);
750    }
751}