These will be used from other source files in upcoming commits.
-static const char *
-parse_nxm_field_bits(const char *s, uint32_t *headerp, int *ofsp, int *n_bitsp)
+const char *
+nxm_parse_field_bits(const char *s, uint32_t *headerp, int *ofsp, int *n_bitsp)
{
const char *full_s = s;
const char *name;
{
const char *full_s = s;
const char *name;
int src_ofs, dst_ofs;
int src_n_bits, dst_n_bits;
int src_ofs, dst_ofs;
int src_n_bits, dst_n_bits;
- s = parse_nxm_field_bits(s, &src, &src_ofs, &src_n_bits);
+ s = nxm_parse_field_bits(s, &src, &src_ofs, &src_n_bits);
if (strncmp(s, "->", 2)) {
ovs_fatal(0, "%s: missing `->' following source", full_s);
}
s += 2;
if (strncmp(s, "->", 2)) {
ovs_fatal(0, "%s: missing `->' following source", full_s);
}
s += 2;
- s = parse_nxm_field_bits(s, &dst, &dst_ofs, &dst_n_bits);
+ s = nxm_parse_field_bits(s, &dst, &dst_ofs, &dst_n_bits);
if (*s != '\0') {
ovs_fatal(0, "%s: trailing garbage following destination", full_s);
}
if (*s != '\0') {
ovs_fatal(0, "%s: trailing garbage following destination", full_s);
}
ovs_fatal(0, "%s: missing `->' following value", full_s);
}
s += 2;
ovs_fatal(0, "%s: missing `->' following value", full_s);
}
s += 2;
- s = parse_nxm_field_bits(s, &dst, &ofs, &n_bits);
+ s = nxm_parse_field_bits(s, &dst, &ofs, &n_bits);
if (*s != '\0') {
ovs_fatal(0, "%s: trailing garbage following destination", full_s);
}
if (*s != '\0') {
ovs_fatal(0, "%s: trailing garbage following destination", full_s);
}
\f
/* nxm_format_reg_move(), nxm_format_reg_load(). */
\f
/* nxm_format_reg_move(), nxm_format_reg_load(). */
-static void
-format_nxm_field_bits(struct ds *s, uint32_t header, int ofs, int n_bits)
+void
+nxm_format_field_bits(struct ds *s, uint32_t header, int ofs, int n_bits)
{
format_nxm_field_name(s, header);
if (ofs == 0 && n_bits == nxm_field_bits(header)) {
{
format_nxm_field_name(s, header);
if (ofs == 0 && n_bits == nxm_field_bits(header)) {
uint32_t dst = ntohl(move->dst);
ds_put_format(s, "move:");
uint32_t dst = ntohl(move->dst);
ds_put_format(s, "move:");
- format_nxm_field_bits(s, src, src_ofs, n_bits);
+ nxm_format_field_bits(s, src, src_ofs, n_bits);
- format_nxm_field_bits(s, dst, dst_ofs, n_bits);
+ nxm_format_field_bits(s, dst, dst_ofs, n_bits);
uint64_t value = ntohll(load->value);
ds_put_format(s, "load:%"PRIu64"->", value);
uint64_t value = ntohll(load->value);
ds_put_format(s, "load:%"PRIu64"->", value);
- format_nxm_field_bits(s, dst, ofs, n_bits);
+ nxm_format_field_bits(s, dst, ofs, n_bits);
}
\f
/* nxm_check_reg_move(), nxm_check_reg_load(). */
}
\f
/* nxm_check_reg_move(), nxm_check_reg_load(). */
int nxm_field_bytes(uint32_t header);
int nxm_field_bits(uint32_t header);
int nxm_field_bytes(uint32_t header);
int nxm_field_bits(uint32_t header);
+const char *nxm_parse_field_bits(const char *s,
+ uint32_t *headerp, int *ofsp, int *n_bitsp);
+void nxm_format_field_bits(struct ds *, uint32_t header, int ofs, int n_bits);
+
/* Dealing with the 'ofs_nbits' members of struct nx_action_reg_load and struct
* nx_action_multipath. */
/* Dealing with the 'ofs_nbits' members of struct nx_action_reg_load and struct
* nx_action_multipath. */