Commit 7d3782cb authored by Niels Möller's avatar Niels Möller
Browse files

* src/lsh_proxy.c: Use the DEFINE_COMMAND_SIMPLE macro.

* src/lshd.c: Likewise.
* src/proxy.c: Likewise.
* src/sexp_commands.c: Likewise.
* src/spki_commands.c: Likewise.

Rev: src/lshd.c:1.101
Rev: src/proxy.c:1.10
Rev: src/sexp_commands.c:1.14
Rev: src/spki_commands.c:1.11
parent bf1959d1
...@@ -256,14 +256,14 @@ make_lshd_options(struct io_backend *backend) ...@@ -256,14 +256,14 @@ make_lshd_options(struct io_backend *backend)
} }
/* Port to listen on */ /* Port to listen on */
COMMAND_SIMPLE(options2local) DEFINE_COMMAND_SIMPLE(options2local, a)
{ {
CAST(lshd_options, options, a); CAST(lshd_options, options, a);
return &options->local->super; return &options->local->super;
} }
/* alist of signature algorithms */ /* alist of signature algorithms */
COMMAND_SIMPLE(options2signature_algorithms) DEFINE_COMMAND_SIMPLE(options2signature_algorithms, a)
{ {
CAST(lshd_options, options, a); CAST(lshd_options, options, a);
return &options->signature_algorithms->super; return &options->signature_algorithms->super;
......
...@@ -244,7 +244,7 @@ STATIC_COLLECT_1(&chain_connections_2); ...@@ -244,7 +244,7 @@ STATIC_COLLECT_1(&chain_connections_2);
(client_hooks object object_list))) (client_hooks object object_list)))
*/ */
COMMAND_SIMPLE(chained_connection) DEFINE_COMMAND_SIMPLE(chained_connection, a)
{ {
CAST(ssh_connection, connection, a); CAST(ssh_connection, connection, a);
return &connection->chain->super.super; return &connection->chain->super.super;
......
...@@ -324,7 +324,7 @@ static struct read_sexp_command read_sexp ...@@ -324,7 +324,7 @@ static struct read_sexp_command read_sexp
(proc (read_sexp file))))))) (proc (read_sexp file)))))))
*/ */
COMMAND_SIMPLE(for_sexp_command) DEFINE_COMMAND_SIMPLE(for_sexp_command, a)
{ {
CAST_SUBTYPE(command, handler, a); CAST_SUBTYPE(command, handler, a);
return for_sexp(handler); return for_sexp(handler);
......
...@@ -63,13 +63,13 @@ EXCEPTION_RAISE((e), make_spki_exception(EXC_SPKI_TYPE, (msg), (expr))) ...@@ -63,13 +63,13 @@ EXCEPTION_RAISE((e), make_spki_exception(EXC_SPKI_TYPE, (msg), (expr)))
/* Various conversion functions */ /* Various conversion functions */
COMMAND_SIMPLE(spki_signer2verifier) DEFINE_COMMAND_SIMPLE(spki_signer2verifier, a)
{ {
CAST_SUBTYPE(signer, private, a); CAST_SUBTYPE(signer, private, a);
return &SIGNER_GET_VERIFIER(private)->super; return &SIGNER_GET_VERIFIER(private)->super;
} }
COMMAND_SIMPLE(spki_verifier2public) DEFINE_COMMAND_SIMPLE(spki_verifier2public, a)
{ {
CAST_SUBTYPE(verifier, v, a); CAST_SUBTYPE(verifier, v, a);
return &spki_make_public_key(v)->super; return &spki_make_public_key(v)->super;
...@@ -167,7 +167,7 @@ do_spki_sexp2signer(struct command *s, ...@@ -167,7 +167,7 @@ do_spki_sexp2signer(struct command *s,
} }
/* (parse algorithms sexp) -> signer */ /* (parse algorithms sexp) -> signer */
COMMAND_SIMPLE(spki_sexp2signer_command) DEFINE_COMMAND_SIMPLE(spki_sexp2signer_command, a)
{ {
CAST_SUBTYPE(alist, algorithms, a); CAST_SUBTYPE(alist, algorithms, a);
NEW(spki_parse_key, self); NEW(spki_parse_key, self);
...@@ -248,7 +248,7 @@ do_spki_sexp2keypair(struct command *s, ...@@ -248,7 +248,7 @@ do_spki_sexp2keypair(struct command *s,
/* (parse algorithms sexp) -> one or more keypairs */ /* (parse algorithms sexp) -> one or more keypairs */
COMMAND_SIMPLE(spki_sexp2keypair_command) DEFINE_COMMAND_SIMPLE(spki_sexp2keypair_command, a)
{ {
CAST_SUBTYPE(alist, algorithms, a); CAST_SUBTYPE(alist, algorithms, a);
NEW(spki_parse_key, self); NEW(spki_parse_key, self);
...@@ -286,7 +286,7 @@ do_spki_add_acl(struct command *s, ...@@ -286,7 +286,7 @@ do_spki_add_acl(struct command *s,
COMMAND_RETURN(c, self->ctx); COMMAND_RETURN(c, self->ctx);
} }
COMMAND_SIMPLE(spki_add_acl_command) DEFINE_COMMAND_SIMPLE(spki_add_acl_command, a)
{ {
CAST_SUBTYPE(spki_context, ctx, a); CAST_SUBTYPE(spki_context, ctx, a);
...@@ -299,7 +299,7 @@ COMMAND_SIMPLE(spki_add_acl_command) ...@@ -299,7 +299,7 @@ COMMAND_SIMPLE(spki_add_acl_command)
return &self->super.super; return &self->super.super;
} }
COMMAND_SIMPLE(spki_make_context_command) DEFINE_COMMAND_SIMPLE(spki_make_context_command, a)
{ {
CAST_SUBTYPE(alist, algorithms, a); CAST_SUBTYPE(alist, algorithms, a);
trace("spki_make_context_command\n"); trace("spki_make_context_command\n");
...@@ -338,7 +338,7 @@ make_spki_read_acls(struct alist *algorithms) ...@@ -338,7 +338,7 @@ make_spki_read_acls(struct alist *algorithms)
return res; return res;
} }
COMMAND_SIMPLE(spki_read_acls_command) DEFINE_COMMAND_SIMPLE(spki_read_acls_command, a)
{ {
CAST_SUBTYPE(alist, algorithms, a); CAST_SUBTYPE(alist, algorithms, a);
CAST_SUBTYPE(command, res, spki_read_acl(algorithms)); CAST_SUBTYPE(command, res, spki_read_acl(algorithms));
...@@ -377,7 +377,7 @@ do_spki_add_hostkey(struct command *s, ...@@ -377,7 +377,7 @@ do_spki_add_hostkey(struct command *s,
} }
/* Ignores its argument */ /* Ignores its argument */
COMMAND_SIMPLE(spki_add_hostkey_command) DEFINE_COMMAND_SIMPLE(spki_add_hostkey_command, a)
{ {
NEW(spki_read_hostkey_context, self); NEW(spki_read_hostkey_context, self);
...@@ -391,7 +391,7 @@ COMMAND_SIMPLE(spki_add_hostkey_command) ...@@ -391,7 +391,7 @@ COMMAND_SIMPLE(spki_add_hostkey_command)
return &self->super.super; return &self->super.super;
} }
COMMAND_SIMPLE(spki_return_hostkeys) DEFINE_COMMAND_SIMPLE(spki_return_hostkeys, a)
{ {
CAST(spki_read_hostkey_context, self, a); CAST(spki_read_hostkey_context, self, a);
trace("spki_return_hostkeys\n"); trace("spki_return_hostkeys\n");
...@@ -415,7 +415,7 @@ COMMAND_SIMPLE(spki_return_hostkeys) ...@@ -415,7 +415,7 @@ COMMAND_SIMPLE(spki_return_hostkeys)
file))))) file)))))
*/ */
COMMAND_SIMPLE(spki_read_hostkeys_command) DEFINE_COMMAND_SIMPLE(spki_read_hostkeys_command, a)
{ {
CAST_SUBTYPE(alist, algorithms, a); CAST_SUBTYPE(alist, algorithms, a);
CAST_SUBTYPE(command, res, spki_read_hostkeys(algorithms)); CAST_SUBTYPE(command, res, spki_read_hostkeys(algorithms));
...@@ -453,7 +453,7 @@ do_spki_add_userkey(struct command *s, ...@@ -453,7 +453,7 @@ do_spki_add_userkey(struct command *s,
} }
/* Ignores its argument */ /* Ignores its argument */
COMMAND_SIMPLE(spki_add_userkey_command) DEFINE_COMMAND_SIMPLE(spki_add_userkey_command, a)
{ {
NEW(spki_read_userkey_context, self); NEW(spki_read_userkey_context, self);
(void) a; (void) a;
...@@ -465,7 +465,7 @@ COMMAND_SIMPLE(spki_add_userkey_command) ...@@ -465,7 +465,7 @@ COMMAND_SIMPLE(spki_add_userkey_command)
return &self->super.super; return &self->super.super;
} }
COMMAND_SIMPLE(spki_return_userkeys) DEFINE_COMMAND_SIMPLE(spki_return_userkeys, a)
{ {
CAST(spki_read_userkey_context, self, a); CAST(spki_read_userkey_context, self, a);
trace("spki_return_userkeys\n"); trace("spki_return_userkeys\n");
...@@ -499,7 +499,7 @@ make_spki_read_userkeys(struct alist *algorithms) ...@@ -499,7 +499,7 @@ make_spki_read_userkeys(struct alist *algorithms)
return res; return res;
} }
COMMAND_SIMPLE(spki_read_userkeys_command) DEFINE_COMMAND_SIMPLE(spki_read_userkeys_command, a)
{ {
CAST_SUBTYPE(alist, algorithms, a); CAST_SUBTYPE(alist, algorithms, a);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment