Lines Matching refs:cmd

106 static void telnet_reply_dont_command(struct telnet_simple_command *cmd)  in telnet_reply_dont_command()  argument
108 switch (cmd->opt) { in telnet_reply_dont_command()
114 cmd->op = NVT_CMD_WILL_NOT; in telnet_reply_dont_command()
116 cmd->op = NVT_CMD_WILL; in telnet_reply_dont_command()
121 cmd->op = NVT_CMD_WILL_NOT; in telnet_reply_dont_command()
125 telnet_command_send_reply((uint8_t *)cmd, in telnet_reply_dont_command()
129 static void telnet_reply_do_command(struct telnet_simple_command *cmd) in telnet_reply_do_command() argument
131 switch (cmd->opt) { in telnet_reply_do_command()
133 cmd->op = NVT_CMD_WILL; in telnet_reply_do_command()
140 cmd->op = NVT_CMD_WILL; in telnet_reply_do_command()
142 cmd->op = NVT_CMD_WILL_NOT; in telnet_reply_do_command()
147 cmd->op = NVT_CMD_WILL_NOT; in telnet_reply_do_command()
151 telnet_command_send_reply((uint8_t *)cmd, in telnet_reply_do_command()
155 static void telnet_reply_command(struct telnet_simple_command *cmd) in telnet_reply_command() argument
157 if (!cmd->iac) { in telnet_reply_command()
161 switch (cmd->op) { in telnet_reply_command()
173 telnet_reply_do_command(cmd); in telnet_reply_command()
176 telnet_reply_dont_command(cmd); in telnet_reply_command()
179 LOG_DBG("Operation %u not handled", cmd->op); in telnet_reply_command()
249 static inline int telnet_handle_command(struct telnet_simple_command *cmd) in telnet_handle_command() argument
252 if (cmd->iac != NVT_CMD_IAC) { in telnet_handle_command()
257 LOG_DBG("Got a command %u/%u/%u", cmd->iac, cmd->op, cmd->opt); in telnet_handle_command()
258 telnet_reply_command(cmd); in telnet_handle_command()
261 if (cmd->op == NVT_CMD_SB) { in telnet_handle_command()
271 struct telnet_simple_command *cmd = in telnet_recv() local
307 cmd->op = *(buf + off); in telnet_recv()
312 if (telnet_command_length(cmd->op) > in telnet_recv()
318 cmd->opt = *(buf + off); in telnet_recv()
324 ret = telnet_handle_command(cmd); in telnet_recv()
331 memset(cmd, 0, sizeof(*cmd)); in telnet_recv()
338 cmd->iac = *(buf + off); in telnet_recv()