@@ -24,14 +24,25 @@ EventMap<Modifier> modifiers = {
24
24
{" connect<" , Modifier::ADD},
25
25
{" accept<" , Modifier::ADD},
26
26
{" getsockopt<" , Modifier::ADD},
27
+ {" sendto<" , Modifier::ADD},
28
+ {" sendto>" , Modifier::ADD},
29
+ {" sendmsg<" , Modifier::ADD},
30
+ {" sendmsg>" , Modifier::ADD},
31
+ {" sendmmsg<" , Modifier::ADD},
32
+ {" recvfrom<" , Modifier::ADD},
33
+ {" recvfrom>" , Modifier::ADD},
34
+ {" recvmsg<" , Modifier::ADD},
35
+ {" recvmsg>" , Modifier::ADD},
36
+ {" recvmmsg<" , Modifier::ADD},
37
+ {" recvmmsg>" , Modifier::ADD},
27
38
},
28
39
Modifier::INVALID,
29
40
};
30
41
31
42
} // namespace
32
43
33
44
NetworkSignalHandler::NetworkSignalHandler (sinsp* inspector, std::shared_ptr<ConnectionTracker> conn_tracker, system_inspector::Stats* stats)
34
- : event_extractor_(std::make_unique<system_inspector::EventExtractor>()), conn_tracker_(std::move(conn_tracker)), stats_(stats), collect_connection_status_(true ) {
45
+ : event_extractor_(std::make_unique<system_inspector::EventExtractor>()), conn_tracker_(std::move(conn_tracker)), stats_(stats), collect_connection_status_(true ), track_send_recv_( false ) {
35
46
event_extractor_->Init (inspector);
36
47
}
37
48
@@ -141,6 +152,28 @@ SignalHandler::Result NetworkSignalHandler::HandleSignal(sinsp_evt* evt) {
141
152
}
142
153
143
154
std::vector<std::string> NetworkSignalHandler::GetRelevantEvents () {
155
+ if (track_send_recv_) {
156
+ return {
157
+ " close<" ,
158
+ " shutdown<" ,
159
+ " connect<" ,
160
+ " accept<" ,
161
+ " getsockopt<" ,
162
+ " sendto<" ,
163
+ " sendto>" ,
164
+ " sendmsg<" ,
165
+ " sendmsg>" ,
166
+ " sendmmsg<" ,
167
+ " recvfrom<" ,
168
+ " recvfrom>" ,
169
+ " recvmsg<" ,
170
+ " recvmsg>" ,
171
+ " recvmmsg<" ,
172
+ " recvmmsg>" ,
173
+ " recvmsg<" ,
174
+ " recvmsg>" ,
175
+ };
176
+ }
144
177
return {" close<" , " shutdown<" , " connect<" , " accept<" , " getsockopt<" };
145
178
}
146
179
0 commit comments