Code to process RAs and initialization phase
For receiving RA and sending RA NetworkManager uses libndp library. This library is used in class NM_TYPE_LNDP_RDISC (defined in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 file src/rdisc/nm-lndp-rdisc.c) which is a platform specific class tailored for cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 Linux OS. This class inherits from class NM_TYPE_RDISC (defined in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 file src/rdisc/nm-rdisc.c) which is a platform independent base class. It contains functionality that is platform independent so cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365oretically NetworkManager can be more easily ported to, e.g. FreeBSD.
To create a new object of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 type NM_TYPE_LNDP_RDISC it is necessary to call function nm_lndp_rdisc_new(). This is, for example, done by cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 class NM_DEVICE_TYPE in function addrconf6_start() for each device for which IPv6 configuration is started.
Now, if NetworkManager will use RAs or not depends on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 configuration setting for IPv6 that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 user defines. If you go to configuration dialog for some network interface cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re is a setting for IPv6 configuration which might be ON or OFF. In case it is OFF, no IPv6 configuration will be done. If IPv6 configuration is enabled (switch placed in ON state) cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 specific configuration methods should be selected. The selected option is checked in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 function src/devices/nm-device.c:act_stage3_ip6_config_start(), where, depending on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 option selected, a specific initialization is started:
- Automatic (method NM_SETTING_IP6_CONFIG_METHOD_AUTO)
Start full IPv6 configuration by calling src/devices/nm-device.c:addrconf6_start() function.
- Automatic, DHCP only (method NM_SETTING_IP6_CONFIG_METHOD_DHCP)
Only configuration based on DHCP parameters received will be done. This type of configuration is initiated by calling function src/devices/nm-device.c:dhcp_start().
- Manual (method NM_SETTING_IP6_CONFIG_METHOD_MANUAL)
Manual configuration using parameters specified in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 configuration dialog and nothing else. The configuration of this type is initiated by calling function nm_ip6_config_new() which returns appropriate IPv6 configuration object.
- Link-local Only (method NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)
Initiate only a link-local address configuration by calling function src/devices/nm-device.c:linklocal6_start().
nm_rdisc_start() is called with a pointer to NM_LNDP_RDISC class (defined in src/rdisc/nm_lndp_rdisc.c). Note that a method (nm_rdisc_start()) from a base class (NM_RDISC_TYPE, defined in src/rdisc/nm_rdisc.c) is called with a pointer to a subclass of a NM_RDISC_TYPE! Method in a base class does cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 following:
- Checks that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re is a subclass which defined virtual method start() (gassert(klass->start)).
- Initializes timeout for cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 configuration process. If timeout fires, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n rdisc_ra_timeout_cb() will be called that emits NM_RDISC_RA_TIMEOUT signal.
- Invokes a method start() from a subclass. Subclass is, as already said, NM_LNDP_RDISC and cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 given method registers a callback src/rdisc/nm-lndp-rdisc.c:receive_ra() with libndp library. The callback is called by libndp library whenever RA is received.
- Starts solicit process by invoking solicit() method. This method schedules RS to be sent in certain amount of time (variable next) by send_rs() method. This method, actually, invokes send_rs() method from a subclass (src/nm-rdisc/nm-rdisc-linux.c:send_rs()) which sends RS using libndp library. Note that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 number of RSes sent is bounded and after certain amount of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365m sent cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 process is stopped under cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 assumption that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365re is no IPv6 capable router on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 network.
- After RA has been received and processed cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 application of configuration parameters is done in src/device/nm-device.c:rdisc_config_changed() method. This callback is achieved by registering to NM_RDISC_CONFIG_CHANGED signal that is emitted by src/rdisc/nm-rdisc.c class whenever IPv6 configuration changes.
So, in conclusion, when link local configuration is finished, RA processing is started. The RA processing consists of waiting for RA in src/rdisc/nm-lndp-rdisc.c:receive_ra(). If RA doesn't arrive is certain amount of time cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n RS is sent in function src/nm-rdisc/nm-rdisc-linux.c:send_rs().
RA processing
When RA is received it is processed by cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 function src/rdisc/nm-lndp-rdisc.c:receive_ra(). The following configuration options are processed from RA by cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 given function:
- DHCP level.
- Default gateway.
- Addresses and routes.
- DNS information (RDNSS option).
- DNS search list (DNSSL option).
- Hop limit.
- MTU.
All cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 options that were parsed are stored (or removed from) a private attributes of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 base object (NMRDisc defined in src/rdisc/nm-rdisc.h).
Finally, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 method src/nm-rdisc.c:nm_rdisc_ra_received() is called to cancel all cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 timeouts. It will also emit signal NM_RDISC_CONFIG_CHANGED that will trigger application of received configuration parameters to a networking device.
Processing RS/RA
Applying IPv6 configuration data
Application of received IPv6 configuration data is done in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 method src/device/nm-device.c:rdisc_config_changed(). IPv6 configuration is stored in IPv6 configuration object NM_TYPE_IP6_CONFIG defined in src/nm-ip6-config.c.
Note that this isn't cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 real application of configuration data, but only that cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 configuration data is stored in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 appropriate object.
The function that really applies configuration data is src/devices/nm-device.c:ip6_config_merge_and_apply().
The function that really applies configuration data is src/devices/nm-device.c:ip6_config_merge_and_apply().
No comments:
Post a Comment