| 138 | } |
| 139 | |
| 140 | static struct command_result *param_id_addr_u16(struct command *cmd, |
| 141 | const char *name, |
| 142 | const char *buffer, |
| 143 | const jsmntok_t *tok, |
| 144 | const u16 **port) |
| 145 | { |
| 146 | u16 val; |
| 147 | if (*port) { |
| 148 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 149 | "Can't specify port as both xxx@yyy:port " |
| 150 | "and separate argument"); |
| 151 | } |
| 152 | if (json_to_u16(buffer, tok, &val)) { |
| 153 | if (val == 0) |
| 154 | return command_fail_badparam(cmd, name, buffer, tok, |
| 155 | "should be non-zero"); |
| 156 | *port = tal_dup(cmd, u16, &val); |
| 157 | return NULL; |
| 158 | } |
| 159 | |
| 160 | return command_fail_badparam(cmd, name, buffer, tok, |
| 161 | "should be a 16-bit integer"); |
| 162 | } |
| 163 | |
| 164 | static struct command_result *json_connect(struct command *cmd, |
| 165 | const char *buffer, |
nothing calls this directly
no test coverage detected