Traditionally, the system signal is the control signal transmitted by the system to the process. For example, SIGINT and sigterm. The transmission of these signals usually indicates the relevant process to complete the corresponding operation, or suspend or terminate, or some other operations. In tor systems, there are two types of signals: traditional signals and controller signals. BelowCodeSection is a simple list of these signals:
/* These signals are defined to help handle_control_signal work. */# ifndef sighup # define sighup 1 # endif # ifndef SIGINT # define SIGINT 2 # endif # ifndef SIGUSR1 # define SIGUSR1 10 # endif # ifndef sigusr2 # define sigusr2 12 # endif # sigterm # define sigterm 15 # endif/* controller signals start at a high number so we don't * conflict with system-defined signals. */# define signewnym 129 # define sigcleardnsccache 130
These signals areProgramSignals of major concern. They all have corresponding response processing functions, all of which are process_signal functions called in the signal callback function. In the previous section, we have mentioned the signal event processing mechanism, so we will not talk about it here. However, it is worth noting that the signal event registration at that time did not register the signewnym signal and sigcleardnscache signal. That is to say, these two signals are not activated by the Signal Processing Event. Where did they appear? The answer is to control connection signal transmission.
We will temporarily put this part of content here and change the title to control. After the control connection is analyzed, the main functions and usage of the system control connection are described in detail here.
To be continued ......