int nl_dect_cell_build_msg(struct nl_msg *msg, struct nl_dect_cell *cell) { struct dectmsg dm = { .dm_index = cell->c_index, }; if (nlmsg_append(msg, &dm, sizeof(dm), NLMSG_ALIGNTO) < 0) goto nla_put_failure; if (cell->ce_mask & CELL_ATTR_NAME) NLA_PUT_STRING(msg, DECTA_CELL_NAME, cell->c_name); if (cell->ce_mask & CELL_ATTR_FLAGS) NLA_PUT_U32(msg, DECTA_CELL_FLAGS, cell->c_flags); if (cell->ce_mask & CELL_ATTR_LINK) NLA_PUT_U8(msg, DECTA_CELL_CLUSTER, cell->c_link); return 0; nla_put_failure: return -NLE_MSGSIZE; } static struct trans_tbl cell_flags[] = { __ADD(DECT_CELL_CCP, ccp) __ADD(DECT_CELL_SLAVE, slave) __ADD(DECT_CELL_MONITOR, monitor) }; char *nl_dect_cell_flags2str(uint32_t flags, char *buf, size_t len) { return __flags2str(flags, buf, len, cell_flags, ARRAY_SIZE(cell_flags)); } uint32_t nl_dect_cell_str2flags(const char *str) { return __str2flags(str, cell_flags, ARRAY_SIZE(cell_flags)); } /** @cond SKIP */ struct nl_object_ops nl_dect_cell_obj_ops = { .oo_name = "nl_dect/cell", .oo_size = sizeof(struct nl_dect_cell), .oo_free_data = cell_free_data, .oo_dump = { [NL_DUMP_LINE] = cell_dump, }, .oo_id_attrs = CELL_ATTR_NAME,
char *rtnl_link_vlan_flags2str(int flags, char *buf, size_t len) { return __flags2str(flags, buf, len, vlan_flags, ARRAY_SIZE(vlan_flags)); }
static char *rule_attrs2str(int attrs, char *buf, size_t len) { return __flags2str(attrs, buf, len, rule_attrs, ARRAY_SIZE(rule_attrs)); }
static char *nfnl_log_attrs2str(int attrs, char *buf, size_t len) { return __flags2str(attrs, buf, len, nfnl_log_attrs, ARRAY_SIZE(nfnl_log_attrs)); }
char *nfnl_log_flags2str(unsigned int flags, char *buf, size_t len) { return __flags2str(flags, buf, len, log_flags, ARRAY_SIZE(log_flags)); }
char * nfnl_ct_status2str(int flags, char *buf, size_t len) { return __flags2str(flags, buf, len, status_flags, ARRAY_SIZE(status_flags)); }
char *rtnl_route_nh_flags2str(int flags, char *buf, size_t len) { return __flags2str(flags, buf, len, nh_flags, ARRAY_SIZE(nh_flags)); }
/** * Convert inet diag extension flags to a string. * @arg attrs inet diag extension flags (e.g., (IDIAG_ATTR_MEMINFO | * IDIAG_ATTR_CONG | IDIAG_ATTR_TOS)) * @arg buf Output buffer to hold string representation * @arg len length in bytes of the output buffer */ char *idiagnl_exts2str(uint8_t attrs, char *buf, size_t len) { return __flags2str(attrs, buf, len, idiag_exts, ARRAY_SIZE(idiag_exts)); }
static char *addr_attrs2str(int attrs, char *buf, size_t len) { return __flags2str(attrs, buf, len, addr_attrs, ARRAY_SIZE(addr_attrs)); }
static char *inet6_flags2str(int flags, char *buf, size_t len) { return __flags2str(flags, buf, len, inet6_flags, ARRAY_SIZE(inet6_flags)); }
char* xfrmnl_ae_flags2str(int flags, char *buf, size_t len) { return __flags2str (flags, buf, len, ae_flags, ARRAY_SIZE(ae_flags)); }
char * nfnl_exp_flags2str(int flags, char *buf, size_t len) { return __flags2str(flags, buf, len, flag_table, ARRAY_SIZE(flag_table)); }
char *rtnl_link_bridge_flags2str(int flags, char *buf, size_t len) { return __flags2str(flags, buf, len, bridge_flags, ARRAY_SIZE(bridge_flags)); }