RnaSessStart
This function is called when Dial-Up Networking wants the SMM to start managing the session. The overlaying SMM should do the following during this function.
- Call RnaGetDevicePort to get the information of the connection Dial-Up Networking wants to start the session. The device information contains the class of the device through which the connection was made. The overlaying SMM needs to verify that it can handle the device class.
- The overlaying SMM also needs to verify all other conditions (for example the session types, etc.) to ensure that it wants to manage the session.
- If the overlaying SMM does not want to manage the session, it calls the Start function of the overlaid SMM, and returns to Dial-Up Networking when the overlaid SMM returns.
- If the overlaying SMM wants to it can proceed to manage the session. The SMM can manage the session in two ways:
- If the overlaying wants to perform a short task, it can do so within the RnaSessStart function. When it finishes managing the session, it can hand off the control to the overlaid SMM by calling its Start function. When the overlaid SMM returns it can return to Dial-Up Networking.
- If the overlaying wants to perform a long task, it should spawn a new thread to manage the session, and returns to Dial-Up Networking immediately after the thread starts. When the thread finishes managing the session, , it can hand off the control to the overlaid SMM by calling its Start function. In this case if the overlaid SMM returns failure, the overlaying SMM needs to terminate the session by calling the RnaComplete function.
In the sample, the function is named SMMSessStart. It verifies the session is for the "COM" device class and the "initiator" session type (client) before it spawns a session management thread to manage the session and returns to Dial-Up Networking. If either condition is not met, it hands off the control to the overlaid SMM (SMM for PPP) immediately.