gf
void gf_add_RAW(gf out, const gf a, const gf b)
void gf_sub_RAW(gf out, const gf a, const gf b)
void gf_bias(gf a, int amt)
void gf_weak_reduce(gf a)
void ossl_gf_sqr(gf_s *RESTRICT cs, const gf as)
void ossl_gf_mul(gf_s *RESTRICT cs, const gf as, const gf bs)
void ossl_gf_mulw_unsigned(gf_s *RESTRICT cs, const gf as, uint32_t b)
void gf_add_RAW(gf out, const gf a, const gf b)
void gf_sub_RAW(gf out, const gf a, const gf b)
void gf_bias(gf a, int amt)
void gf_weak_reduce(gf a)
void ossl_gf_sqr(gf_s *RESTRICT cs, const gf as)
void ossl_gf_mul(gf_s *RESTRICT cs, const gf as, const gf bs)
void ossl_gf_mulw_unsigned(gf_s *RESTRICT cs, const gf as, uint32_t b)
gf eu;
gf a, b, c;
gf a, b, c;
gf L0;
gf L0;
gf a, b;
gf a, b, c;
gf x, y, z, t;
gf u;
gf a, b, c, d;
static void gf_invert(gf y, const gf x, int assert_nonzero)
gf x1, x2, z2, x3, z3, t1, t2;
gf t1, t2;
gf a, b, c, d;
void gf_sub(gf d, const gf a, const gf b)
static const gf MODULUS = {
void gf_add(gf d, const gf a, const gf b)
mask_t gf_eq(const gf a, const gf b)
gf c;
mask_t gf_isr(gf a, const gf x)
gf L0, L1, L2;
void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_hibit)
gf red;
mask_t gf_hibit(const gf x)
gf y;
mask_t gf_lobit(const gf x)
gf y;
mask_t gf_deserialize(gf x, const uint8_t serial[SER_BYTES], int with_hibit,
void gf_strong_reduce(gf a)
static ossl_inline void gf_sub_nr(gf c, const gf a, const gf b)
static ossl_inline void gf_subx_nr(gf c, const gf a, const gf b, int amt)
static ossl_inline void gf_mulw(gf c, const gf a, int32_t w)
static ossl_inline void gf_cond_sel(gf x, const gf y, const gf z, mask_t is_z)
static ossl_inline void gf_cond_neg(gf x, mask_t neg)
gf y;
static ossl_inline void gf_cond_swap(gf x, gf_s *RESTRICT y, mask_t swap)
static INLINE_UNUSED void gf_copy(gf out, const gf a)
static INLINE_UNUSED void gf_add_RAW(gf out, const gf a, const gf b);
static INLINE_UNUSED void gf_sub_RAW(gf out, const gf a, const gf b);
static INLINE_UNUSED void gf_bias(gf inout, int amount);
static INLINE_UNUSED void gf_weak_reduce(gf inout);
void gf_strong_reduce(gf inout);
void gf_add(gf out, const gf a, const gf b);
void gf_sub(gf out, const gf a, const gf b);
void ossl_gf_mul(gf_s *RESTRICT out, const gf a, const gf b);
void ossl_gf_mulw_unsigned(gf_s *RESTRICT out, const gf a, uint32_t b);
void ossl_gf_sqr(gf_s *RESTRICT out, const gf a);
mask_t gf_isr(gf a, const gf x); /** a^2 x = 1, QNR, or 0 if x=0. Return true if successful */
mask_t gf_eq(const gf x, const gf y);
mask_t gf_lobit(const gf x);
mask_t gf_hibit(const gf x);
void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_highbit);
mask_t gf_deserialize(gf x, const uint8_t serial[SER_BYTES], int with_hibit,
static const gf ZERO = { { { 0 } } }, ONE = { { { 1 } } };
static ossl_inline void gf_sqrn(gf_s *RESTRICT y, const gf x, int n)
gf tmp;
gf a, b, c;
gf z;
gf x, y, z, t;
const sopno gf = g->firststate+1; /* +1 for OEND */
endp = walk(m, start, stop, gf, gl, true);
endp = walk(m, m->coldp, stop, gf, gl, false);
dp = dissect(m, m->coldp, endp, gf, gl);
dp = backref(m, m->coldp, endp, gf, gl, (sopno)0, 0);
endp = walk(m, m->coldp, endp-1, gf, gl, false);
dp = backref(m, m->coldp, endp, gf, gl, (sopno)0, 0);
#define NG_HCI_OPCODE(gf,cf) ((((gf) & 0x3f) << 10) | ((cf) & 0x3ff))
genl_family_id(const struct genl_family *gf)
MPASS(gf >= &families[0] && gf < &families[MAX_FAMILIES]);
return ((uint16_t)(gf - &families[0]) + GENL_MIN_ID);
struct genl_family *gf;
gf = &families[family_id];
if (ghdr->cmd >= gf->family_cmd_size || gf->family_cmds[ghdr->cmd].cmd_cb == NULL) {
gf->family_name, ghdr->cmd);
struct genl_cmd *cmd = &gf->family_cmds[ghdr->cmd];
gf->family_name, ghdr->cmd);
gf->family_name, ghdr->cmd);
gf->family_name, cmd->cmd_name, ghdr->cmd, hdr->nlmsg_len);
const struct genl_family *gf, struct nl_writer *nw)
ghdr_new->version = gf->family_version;
nlattr_add_string(nw, CTRL_ATTR_FAMILY_NAME, gf->family_name);
nlattr_add_u16(nw, CTRL_ATTR_FAMILY_ID, genl_family_id(gf));
nlattr_add_u32(nw, CTRL_ATTR_VERSION, gf->family_version);
nlattr_add_u32(nw, CTRL_ATTR_HDRSIZE, gf->family_hdrsize);
nlattr_add_u32(nw, CTRL_ATTR_MAXATTR, gf->family_attr_max);
if (gf->family_cmd_size > 0) {
for (int i = 0, cnt=0; i < gf->family_cmd_size; i++) {
struct genl_cmd *cmd = &gf->family_cmds[i];
if (gf->family_num_groups > 0) {
if (gg->group_family != gf)
NL_LOG(LOG_DEBUG, "unable to dump family %s state (ENOMEM)", gf->family_name);
struct genl_family *gf = &families[i];
if (gf->family_name == NULL)
attrs.family_id != genl_family_id(gf))
strcmp(attrs.family_name, gf->family_name) != 0)
return (dump_family(hdr, &ghdr, gf, npt->nw));
struct genl_family *gf = &families[i];
if (gf->family_name != NULL) {
error = dump_family(hdr, &ghdr, gf, npt->nw);
struct genl_family *gf;
gf = genl_family(family_id);
dump_family(&hdr, &ghdr, gf, &nw);
struct genl_family *gf;
gf = NULL;
gf = &families[i];
KASSERT(gf, ("%s: maximum of %u generic netlink families allocated",
*gf = (struct genl_family) {
family_id = genl_family_id(gf);
NL_LOG(LOG_DEBUG2, "Registered family %s id %d", gf->family_name,
EVENTHANDLER_INVOKE(genl_family_event, gf->family_name, family_id,
struct genl_family *gf;
gf = genl_family(family_id);
EVENTHANDLER_INVOKE(genl_family_event, gf->family_name,
if (gg->group_family == gf && gg->group_name != NULL) {
if (gf->family_cmds != NULL)
free(gf->family_cmds, M_NETLINK);
bzero(gf, sizeof(*gf));
struct genl_family *gf;
gf = genl_family(family_id);
cmd_size = gf->family_cmd_size;
if (cmd_size > gf->family_cmd_size) {
memcpy(data, gf->family_cmds,
gf->family_cmd_size * sizeof(struct genl_cmd));
old_data = gf->family_cmds;
gf->family_cmds = data;
gf->family_cmd_size = cmd_size;
MPASS(gf->family_cmds[cmd->cmd_num].cmd_cb == NULL);
gf->family_cmds[cmd->cmd_num] = cmds[i];
cmd->cmd_name, cmd->cmd_num, gf->family_name);
struct genl_family *gf;
gf = genl_family(family_id);
if (groups[i].group_family == gf &&
gf->family_num_groups++;
gg->group_family = gf;
struct genl_family *gf;
gf = genl_family(family_id);
MPASS(gg->group_family == gf);
MPASS(gf->family_num_groups > 0);
gf->family_num_groups--;
if (ferror(gf))
fclose(gf);
FILE *gf;
if ((gf = fopen(gfn, "r")) == NULL)
if ((line = fgetln(gf, &len)) == NULL)