void cmd_list_windows_server(struct cmd *self, struct cmd_ctx *ctx) { struct session *s; RB_FOREACH(s, sessions, &sessions) cmd_list_windows_session(self, s, ctx, 1); }
static void cmd_list_windows_server(struct cmd *self, struct cmdq_item *item) { struct session *s; RB_FOREACH(s, sessions, &sessions) cmd_list_windows_session(self, s, item, 1); }
static enum cmd_retval cmd_list_windows_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; if (args_has(args, 'a')) cmd_list_windows_server(self, item); else cmd_list_windows_session(self, item->target.s, item, 0); return (CMD_RETURN_NORMAL); }
enum cmd_retval cmd_list_windows_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; if (args_has(args, 'a')) cmd_list_windows_server(self, cmdq); else cmd_list_windows_session(self, cmdq->state.tflag.s, cmdq, 0); return (CMD_RETURN_NORMAL); }
int cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx) { struct args *args = self->args; struct session *s; if (args_has(args, 'a')) cmd_list_windows_server(self, ctx); else { s = cmd_find_session(ctx, args_get(args, 't'), 0); if (s == NULL) return (-1); cmd_list_windows_session(self, s, ctx, 0); } return (0); }
enum cmd_retval cmd_list_windows_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; struct session *s; if (args_has(args, 'a')) cmd_list_windows_server(self, cmdq); else { s = cmd_find_session(cmdq, args_get(args, 't'), 0); if (s == NULL) return (CMD_RETURN_ERROR); cmd_list_windows_session(self, s, cmdq, 0); } return (CMD_RETURN_NORMAL); }