OpenVAS Scanner  5.1.3
ntp.h File Reference
#include <openvas/misc/arglists.h>
Include dependency graph for ntp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int ntp_parse_input (struct arglist *, char *)
 Parses the input sent by the client before the NEW_ATTACK message. More...
 
int ntp_timestamp_host_scan_starts (int, char *)
 
int ntp_timestamp_host_scan_ends (int, char *)
 
int ntp_timestamp_scan_starts (int)
 
int ntp_timestamp_scan_ends (int)
 

Function Documentation

◆ ntp_parse_input()

int ntp_parse_input ( struct arglist *  ,
char *   
)

Parses the input sent by the client before the NEW_ATTACK message.

Definition at line 57 of file ntp.c.

58 {
59  char *str;
60  int result = 1; /* default return value is 1 */
61  int soc = arg_get_value_int (globals, "global_socket");
62 
63  if (*input == '\0')
64  return -1;
65  str = strstr (input, " <|> ");
66  if (str == NULL)
67  return 1;
68 
69  str[0] = '\0';
70 
71  if (strcmp (input, "CLIENT") == 0)
72  {
73  input = str + 5;
74  str = strchr (input, ' ');
75  if (str != NULL)
76  str[0] = '\0';
77 
78  if (input[strlen (input) - 1] == '\n')
79  input[strlen (input) - 1] = '\0';
80 
81  switch (otp_get_client_request (input))
82  {
83  case CREQ_ATTACHED_FILE:
84  ntp_recv_file (globals);
85  break;
86 
87  case CREQ_LONG_ATTACK:
88  result = ntp_long_attack (soc);
89  break;
90 
91  case CREQ_PREFERENCES:
92  ntp_read_prefs (soc);
93  break;
94 
96  log_write ("Stopping the whole test (requested by client)");
97  hosts_stop_all ();
98  break;
99 
100  case CREQ_NVT_INFO:
101  {
102  comm_send_nvt_info (soc);
103  comm_send_preferences (soc);
104  break;
105  }
106 
107  case CREQ_UNKNOWN:
108  break;
109  }
110  }
111 
112  return (result);
113 }
void hosts_stop_all(void)
Definition: hosts.c:230
void log_write(const char *str,...)
Write into the logfile / syslog.
Definition: log.c:140
void comm_send_nvt_info(int soc)
Send the OTP NVT_INFO message and then handle any COMPLETE_LIST.
Definition: comm.c:395
void comm_send_preferences(int soc)
Sends the preferences of the scanner.
Definition: comm.c:279
client_request_t otp_get_client_request(char *str)
Find the enum identifier for the client request which is given.
Definition: otp.c:42

References CREQ_ATTACHED_FILE, and otp_get_client_request().

Here is the call graph for this function:

◆ ntp_timestamp_host_scan_ends()

int ntp_timestamp_host_scan_ends ( int  ,
char *   
)

Definition at line 437 of file ntp.c.

438 {
439  return __ntp_timestamp_scan_host (soc, "HOST_END", host);
440 }
Host information, implemented as doubly linked list.
Definition: hosts.c:44

◆ ntp_timestamp_host_scan_starts()

int ntp_timestamp_host_scan_starts ( int  ,
char *   
)

Definition at line 431 of file ntp.c.

432 {
433  return __ntp_timestamp_scan_host (soc, "HOST_START", host);
434 }
Host information, implemented as doubly linked list.
Definition: hosts.c:44

◆ ntp_timestamp_scan_ends()

int ntp_timestamp_scan_ends ( int  )

Definition at line 425 of file ntp.c.

426 {
427  return __ntp_timestamp_scan (soc, "SCAN_END");
428 }

◆ ntp_timestamp_scan_starts()

int ntp_timestamp_scan_starts ( int  )

Definition at line 419 of file ntp.c.

420 {
421  return __ntp_timestamp_scan (soc, "SCAN_START");
422 }