35{
36
37
38
39
40
41 if (!(g_context = b2nsm_init2(nodename, 0, 0, 0, 0))) {
42
43 fprintf(RFNSMOUT, "RFNSM : %s initialization failure, %s\n",
44 nodename, b2nsm_strerror());
45 g_context = 0;
46 }
47 nsmlib_usesig(g_context, 0);
48 m_nodename = nodename;
49
50
51 b2nsm_logging(RFNSMOUT);
52
53
54 nsmlib_debuglevel(0);
55
56
57 g_nsmserver = server;
58
59
60
61 if (b2nsm_callback("RC_LOAD", m_Configure) < 0) {
62 fprintf(stderr, "RFNSM : %s hooking CONFIGURE failed, %s\n",
63 m_nodename.c_str(), b2nsm_strerror());
64 }
65
66 if (b2nsm_callback("RC_ABORT", m_UnConfigure) < 0) {
67 fprintf(stderr, "RFNSM : %s hooking UNCONFIGURE failed, %s\n",
68 m_nodename.c_str(), b2nsm_strerror());
69 }
70
71 if (b2nsm_callback("RC_START", m_Start) < 0) {
72 fprintf(stderr, "RFNSM : %s hooking START failed, %s\n",
73 m_nodename.c_str(), b2nsm_strerror());
74 }
75
76 if (b2nsm_callback("RC_STOP", m_Stop) < 0) {
77 fprintf(stderr, "RFNSM : %s hooking STOP failed, %s\n",
78 m_nodename.c_str(), b2nsm_strerror());
79 }
80
81 if (b2nsm_callback("RC_PAUSE", m_Pause) < 0) {
82 fprintf(stderr, "RFNSM : %s hooking PAUSE failed, %s\n",
83 m_nodename.c_str(), b2nsm_strerror());
84 }
85
86 if (b2nsm_callback("RC_RESUME", m_Resume) < 0) {
87 fprintf(stderr, "RFNSM : %s hooking RESUME failed, %s\n",
88 m_nodename.c_str(), b2nsm_strerror());
89 }
90
91 if (b2nsm_callback("RC_RECOVER", m_Restart) < 0) {
92 fprintf(stderr, "RFNSM : %s hooking RESTART failed, %s\n",
93 m_nodename.c_str(), b2nsm_strerror());
94 }
95
96
97 if (b2nsm_callback("RC_STATUS", m_Status) < 0) {
98 fprintf(stderr, "RFNSM : %s hooking STATUS failed, %s\n",
99 m_nodename.c_str(), b2nsm_strerror());
100 }
101
102
103 if (b2nsm_callback("OK", m_OK) < 0) {
104 fprintf(stderr, "RFNSM : %s hooking OK failed, %s\n",
105 m_nodename.c_str(), b2nsm_strerror());
106 }
107 if (b2nsm_callback("ERROR", m_ERROR) < 0) {
108 fprintf(stderr, "RFNSM : %s hooking ERROR failed, %s\n",
109 m_nodename.c_str(), b2nsm_strerror());
110 }
111
112
113 RFNSM_Status::Instance().set_state(RFSTATE_UNCONFIGURED);
114}