summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2023-02-28 17:22:19 +0100
committerMichael Brown2023-03-01 12:55:04 +0100
commit33cb56cf1b7a7138542fe18fd86898fdca2e8f0a (patch)
treeca67d7973089706ca52ddbfd3c6971d92940e54c
parent[http] Use POST method only if the form parameter list is non-empty (diff)
downloadipxe-33cb56cf1b7a7138542fe18fd86898fdca2e8f0a.tar.gz
ipxe-33cb56cf1b7a7138542fe18fd86898fdca2e8f0a.tar.xz
ipxe-33cb56cf1b7a7138542fe18fd86898fdca2e8f0a.zip
[params] Rename "form parameter" to "request parameter"
Prepare for the parameter mechanism to be generalised to specifying request parameters that are passed via mechanisms other than an application/x-www-form-urlencoded form. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/config/general.h2
-rw-r--r--src/core/params.c10
-rw-r--r--src/core/parseopt.c2
-rw-r--r--src/hci/commands/param_cmd.c4
-rw-r--r--src/include/ipxe/params.h16
-rw-r--r--src/include/ipxe/uri.h2
-rw-r--r--src/tests/uri_test.c22
7 files changed, 29 insertions, 29 deletions
diff --git a/src/config/general.h b/src/config/general.h
index 72a6a9a1..e75a2aff 100644
--- a/src/config/general.h
+++ b/src/config/general.h
@@ -150,7 +150,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
//#define POWEROFF_CMD /* Power off command */
//#define IMAGE_TRUST_CMD /* Image trust management commands */
//#define PCI_CMD /* PCI commands */
-//#define PARAM_CMD /* Form parameter commands */
+//#define PARAM_CMD /* Request parameter commands */
//#define NEIGHBOUR_CMD /* Neighbour management commands */
//#define PING_CMD /* Ping command */
//#define CONSOLE_CMD /* Console command */
diff --git a/src/core/params.c b/src/core/params.c
index e1f66acc..23206bef 100644
--- a/src/core/params.c
+++ b/src/core/params.c
@@ -25,7 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/** @file
*
- * Form parameters
+ * Request parameters
*
*/
@@ -37,7 +37,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
static LIST_HEAD ( parameters );
/**
- * Free form parameter list
+ * Free request parameter list
*
* @v refcnt Reference count
*/
@@ -60,7 +60,7 @@ static void free_parameters ( struct refcnt *refcnt ) {
}
/**
- * Find form parameter list by name
+ * Find request parameter list by name
*
* @v name Parameter list name (may be NULL)
* @ret params Parameter list, or NULL if not found
@@ -78,7 +78,7 @@ struct parameters * find_parameters ( const char *name ) {
}
/**
- * Create form parameter list
+ * Create request parameter list
*
* @v name Parameter list name (may be NULL)
* @ret params Parameter list, or NULL on failure
@@ -118,7 +118,7 @@ struct parameters * create_parameters ( const char *name ) {
}
/**
- * Add form parameter
+ * Add request parameter
*
* @v params Parameter list
* @v key Parameter key
diff --git a/src/core/parseopt.c b/src/core/parseopt.c
index 00708008..1dbfc7ae 100644
--- a/src/core/parseopt.c
+++ b/src/core/parseopt.c
@@ -302,7 +302,7 @@ int parse_autovivified_setting ( char *text, struct named_setting *setting ) {
}
/**
- * Parse form parameter list name
+ * Parse request parameter list name
*
* @v text Text
* @ret params Parameter list
diff --git a/src/hci/commands/param_cmd.c b/src/hci/commands/param_cmd.c
index bff04f2f..9e3260de 100644
--- a/src/hci/commands/param_cmd.c
+++ b/src/hci/commands/param_cmd.c
@@ -25,7 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/** @file
*
- * Form parameter commands
+ * Request parameter commands
*
*/
@@ -154,7 +154,7 @@ static int param_exec ( int argc, char **argv ) {
return rc;
}
-/** Form parameter commands */
+/** Request parameter commands */
struct command param_commands[] __command = {
{
.name = "params",
diff --git a/src/include/ipxe/params.h b/src/include/ipxe/params.h
index dd3292ef..955f57ac 100644
--- a/src/include/ipxe/params.h
+++ b/src/include/ipxe/params.h
@@ -3,7 +3,7 @@
/** @file
*
- * Form parameters
+ * Request parameters
*
*/
@@ -12,7 +12,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/list.h>
#include <ipxe/refcnt.h>
-/** A form parameter list */
+/** A request parameter list */
struct parameters {
/** Reference count */
struct refcnt refcnt;
@@ -24,9 +24,9 @@ struct parameters {
struct list_head entries;
};
-/** A form parameter */
+/** A request parameter */
struct parameter {
- /** List of form parameters */
+ /** List of request parameters */
struct list_head list;
/** Key */
const char *key;
@@ -35,7 +35,7 @@ struct parameter {
};
/**
- * Increment form parameter list reference count
+ * Increment request parameter list reference count
*
* @v params Parameter list, or NULL
* @ret params Parameter list as passed in
@@ -47,7 +47,7 @@ params_get ( struct parameters *params ) {
}
/**
- * Decrement form parameter list reference count
+ * Decrement request parameter list reference count
*
* @v params Parameter list, or NULL
*/
@@ -57,7 +57,7 @@ params_put ( struct parameters *params ) {
}
/**
- * Claim ownership of form parameter list
+ * Claim ownership of request parameter list
*
* @v params Parameter list
* @ret params Parameter list
@@ -71,7 +71,7 @@ claim_parameters ( struct parameters *params ) {
return params;
}
-/** Iterate over all form parameters in a list */
+/** Iterate over all request parameters in a list */
#define for_each_param( param, params ) \
list_for_each_entry ( (param), &(params)->entries, list )
diff --git a/src/include/ipxe/uri.h b/src/include/ipxe/uri.h
index e5b7c861..a94b525e 100644
--- a/src/include/ipxe/uri.h
+++ b/src/include/ipxe/uri.h
@@ -84,7 +84,7 @@ struct uri {
const char *equery;
/** Fragment (with original URI encoding) */
const char *efragment;
- /** Form parameters */
+ /** Request parameters */
struct parameters *params;
} __attribute__ (( packed ));
diff --git a/src/tests/uri_test.c b/src/tests/uri_test.c
index 338f479c..5e706032 100644
--- a/src/tests/uri_test.c
+++ b/src/tests/uri_test.c
@@ -92,7 +92,7 @@ struct uri_churi_test {
const char *expected;
};
-/** A form parameter URI test list */
+/** A request parameter URI test list */
struct uri_params_test_list {
/** Key */
const char *key;
@@ -100,7 +100,7 @@ struct uri_params_test_list {
const char *value;
};
-/** A form parameter URI test */
+/** A request parameter URI test */
struct uri_params_test {
/** URI string */
const char *string;
@@ -403,9 +403,9 @@ static void uri_churi_okx ( struct uri_churi_test *test, const char *file,
#define uri_churi_ok( test ) uri_churi_okx ( test, __FILE__, __LINE__ )
/**
- * Report form parameter URI test list result
+ * Report request parameter URI test list result
*
- * @v test Form parameter URI test
+ * @v test Request parameter URI test
* @v uri URI
* @v file Test code file
* @v line Test code line
@@ -437,9 +437,9 @@ static void uri_params_list_okx ( struct uri_params_test *test,
uri_params_list_okx ( test, __FILE__, __LINE__ )
/**
- * Report form parameter URI test result
+ * Report request parameter URI test result
*
- * @v test Form parameter URI test
+ * @v test Request parameter URI test
* @v file Test code file
* @v line Test code line
*/
@@ -879,7 +879,7 @@ static struct uri_churi_test uri_churi[] = {
}
};
-/** Form parameter URI test list */
+/** Request parameter URI test list */
static struct uri_params_test_list uri_params_list[] = {
{
"vendor",
@@ -899,7 +899,7 @@ static struct uri_params_test_list uri_params_list[] = {
}
};
-/** Form parameter URI test */
+/** Request parameter URI test */
static struct uri_params_test uri_params = {
"http://boot.ipxe.org/demo/boot.php##params",
{
@@ -912,7 +912,7 @@ static struct uri_params_test uri_params = {
uri_params_list,
};
-/** Named form parameter URI test list */
+/** Named request parameter URI test list */
static struct uri_params_test_list uri_named_params_list[] = {
{
"mac",
@@ -928,7 +928,7 @@ static struct uri_params_test_list uri_named_params_list[] = {
}
};
-/** Named form parameter URI test */
+/** Named request parameter URI test */
static struct uri_params_test uri_named_params = {
"http://192.168.100.4:3001/register##params=foo",
{
@@ -996,7 +996,7 @@ static void uri_test_exec ( void ) {
/* Current working URI tests */
uri_churi_ok ( uri_churi );
- /* Form parameter URI tests */
+ /* Request parameter URI tests */
uri_params_ok ( &uri_params );
uri_params_ok ( &uri_named_params );
}