Lines Matching full:info
2 * lib/route/link/macsec.c MACsec Link Info
97 struct macsec_info *info; in macsec_alloc() local
106 info = link->l_info; in macsec_alloc()
108 info->cipher_suite = MACSEC_DEFAULT_CIPHER_ID; in macsec_alloc()
109 info->icv_len = DEFAULT_ICV_LEN; in macsec_alloc()
110 info->ce_mask = MACSEC_ATTR_CIPHER_SUITE | MACSEC_ATTR_ICV_LEN; in macsec_alloc()
119 struct macsec_info *info; in macsec_parse() local
122 NL_DBG(3, "Parsing MACsec link info\n"); in macsec_parse()
130 info = link->l_info; in macsec_parse()
133 info->sci = nla_get_u64(tb[IFLA_MACSEC_SCI]); in macsec_parse()
134 info->ce_mask |= MACSEC_ATTR_SCI; in macsec_parse()
138 info->protect = nla_get_u8(tb[IFLA_MACSEC_PROTECT]); in macsec_parse()
139 info->ce_mask |= MACSEC_ATTR_PROTECT; in macsec_parse()
143 info->cipher_suite = nla_get_u64(tb[IFLA_MACSEC_CIPHER_SUITE]); in macsec_parse()
144 info->ce_mask |= MACSEC_ATTR_CIPHER_SUITE; in macsec_parse()
148 info->icv_len = nla_get_u8(tb[IFLA_MACSEC_ICV_LEN]); in macsec_parse()
149 info->ce_mask |= MACSEC_ATTR_ICV_LEN; in macsec_parse()
153 info->encoding_sa = nla_get_u8(tb[IFLA_MACSEC_ENCODING_SA]); in macsec_parse()
154 info->ce_mask |= MACSEC_ATTR_ENCODING_SA; in macsec_parse()
158 info->validate = nla_get_u8(tb[IFLA_MACSEC_VALIDATION]); in macsec_parse()
159 info->ce_mask |= MACSEC_ATTR_VALIDATION; in macsec_parse()
163 info->encrypt = nla_get_u8(tb[IFLA_MACSEC_ENCRYPT]); in macsec_parse()
164 info->ce_mask |= MACSEC_ATTR_ENCRYPT; in macsec_parse()
168 info->send_sci = nla_get_u8(tb[IFLA_MACSEC_INC_SCI]); in macsec_parse()
169 info->ce_mask |= MACSEC_ATTR_INC_SCI; in macsec_parse()
173 info->end_station = nla_get_u8(tb[IFLA_MACSEC_ES]); in macsec_parse()
174 info->ce_mask |= MACSEC_ATTR_ES; in macsec_parse()
178 info->scb = nla_get_u8(tb[IFLA_MACSEC_SCB]); in macsec_parse()
179 info->ce_mask |= MACSEC_ATTR_SCB; in macsec_parse()
183 info->replay_protect = nla_get_u8(tb[IFLA_MACSEC_REPLAY_PROTECT]); in macsec_parse()
184 info->ce_mask |= MACSEC_ATTR_REPLAY_PROTECT; in macsec_parse()
188 info->window = nla_get_u32(tb[IFLA_MACSEC_WINDOW]); in macsec_parse()
189 info->ce_mask |= MACSEC_ATTR_WINDOW; in macsec_parse()
227 static char *flags_str(char *buf, unsigned char len, struct macsec_info *info) in flags_str() argument
232 PRINT_FLAG(tmp, info, protect, 'P'); in flags_str()
233 PRINT_FLAG(tmp, info, encrypt, 'E'); in flags_str()
234 PRINT_FLAG(tmp, info, send_sci, 'S'); in flags_str()
235 PRINT_FLAG(tmp, info, end_station, 'e'); in flags_str()
236 PRINT_FLAG(tmp, info, scb, 's'); in flags_str()
237 PRINT_FLAG(tmp, info, replay_protect, 'R'); in flags_str()
241 switch (info->validate) { in flags_str()
255 sprintf(tmp, " %d", info->encoding_sa); in flags_str()
262 struct macsec_info *info = link->l_info; in macsec_dump_line() local
265 nl_dump(p, "sci %016llx <%s>", ntohll(info->sci), flags_str(tmp, sizeof(tmp), info)); in macsec_dump_line()
270 struct macsec_info *info = link->l_info; in macsec_dump_details() local
274 …ntohll(info->sci), values_on_off[info->protect], info->encoding_sa, values_on_off[info->encrypt], … in macsec_dump_details()
275 VALIDATE_STR[info->validate], in macsec_dump_details()
276 replay_protect_str(tmp, info->replay_protect, info->window)); in macsec_dump_details()
278 info->cipher_suite, info->icv_len); in macsec_dump_details()
283 struct macsec_info *copy, *info = src->l_info; in macsec_clone() local
291 if (!info || !copy) in macsec_clone()
294 memcpy(copy, info, sizeof(struct macsec_info)); in macsec_clone()
301 struct macsec_info *info = link->l_info; in macsec_put_attrs() local
307 if (info->ce_mask & MACSEC_ATTR_SCI) in macsec_put_attrs()
308 NLA_PUT_U64(msg, IFLA_MACSEC_SCI, info->sci); in macsec_put_attrs()
309 else if (info->ce_mask & MACSEC_ATTR_PORT) in macsec_put_attrs()
310 NLA_PUT_U16(msg, IFLA_MACSEC_PORT, htons(info->port)); in macsec_put_attrs()
312 if ((info->ce_mask & MACSEC_ATTR_ENCRYPT)) in macsec_put_attrs()
313 NLA_PUT_U8(msg, IFLA_MACSEC_ENCRYPT, info->encrypt); in macsec_put_attrs()
315 if (info->cipher_suite != MACSEC_DEFAULT_CIPHER_ID || info->icv_len != DEFAULT_ICV_LEN) { in macsec_put_attrs()
316 NLA_PUT_U64(msg, IFLA_MACSEC_CIPHER_SUITE, info->cipher_suite); in macsec_put_attrs()
317 NLA_PUT_U8(msg, IFLA_MACSEC_ICV_LEN, info->icv_len); in macsec_put_attrs()
320 if ((info->ce_mask & MACSEC_ATTR_INC_SCI)) in macsec_put_attrs()
321 NLA_PUT_U8(msg, IFLA_MACSEC_INC_SCI, info->send_sci); in macsec_put_attrs()
323 if ((info->ce_mask & MACSEC_ATTR_ES)) in macsec_put_attrs()
324 NLA_PUT_U8(msg, IFLA_MACSEC_ES, info->end_station); in macsec_put_attrs()
326 if ((info->ce_mask & MACSEC_ATTR_SCB)) in macsec_put_attrs()
327 NLA_PUT_U8(msg, IFLA_MACSEC_SCB, info->scb); in macsec_put_attrs()
329 if ((info->ce_mask & MACSEC_ATTR_PROTECT)) in macsec_put_attrs()
330 NLA_PUT_U8(msg, IFLA_MACSEC_PROTECT, info->protect); in macsec_put_attrs()
332 if ((info->ce_mask & MACSEC_ATTR_REPLAY_PROTECT)) { in macsec_put_attrs()
333 if (info->replay_protect && !(info->ce_mask & MACSEC_ATTR_WINDOW)) in macsec_put_attrs()
336 NLA_PUT_U8(msg, IFLA_MACSEC_REPLAY_PROTECT, info->replay_protect); in macsec_put_attrs()
337 NLA_PUT_U32(msg, IFLA_MACSEC_WINDOW, info->window); in macsec_put_attrs()
340 if ((info->ce_mask & MACSEC_ATTR_VALIDATION)) in macsec_put_attrs()
341 NLA_PUT_U8(msg, IFLA_MACSEC_VALIDATION, info->validate); in macsec_put_attrs()
343 if ((info->ce_mask & MACSEC_ATTR_ENCODING_SA)) in macsec_put_attrs()
344 NLA_PUT_U8(msg, IFLA_MACSEC_ENCODING_SA, info->encoding_sa); in macsec_put_attrs()
450 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_sci() local
454 info->sci = sci; in rtnl_link_macsec_set_sci()
455 info->ce_mask |= MACSEC_ATTR_SCI; in rtnl_link_macsec_set_sci()
470 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_sci() local
474 if (!(info->ce_mask & MACSEC_ATTR_SCI)) in rtnl_link_macsec_get_sci()
478 *sci = info->sci; in rtnl_link_macsec_get_sci()
492 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_port() local
496 info->port = port; in rtnl_link_macsec_set_port()
497 info->ce_mask |= MACSEC_ATTR_PORT; in rtnl_link_macsec_set_port()
511 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_port() local
515 if (!(info->ce_mask & MACSEC_ATTR_PORT)) in rtnl_link_macsec_get_port()
519 *port = info->port; in rtnl_link_macsec_get_port()
526 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_cipher_suite() local
530 info->cipher_suite = cipher_suite; in rtnl_link_macsec_set_cipher_suite()
531 info->ce_mask |= MACSEC_ATTR_CIPHER_SUITE; in rtnl_link_macsec_set_cipher_suite()
538 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_cipher_suite() local
542 if (!(info->ce_mask & MACSEC_ATTR_CIPHER_SUITE)) in rtnl_link_macsec_get_cipher_suite()
546 *cs = info->cipher_suite; in rtnl_link_macsec_get_cipher_suite()
553 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_icv_len() local
560 info->icv_len = icv_len; in rtnl_link_macsec_set_icv_len()
561 info->ce_mask |= MACSEC_ATTR_ICV_LEN; in rtnl_link_macsec_set_icv_len()
568 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_icv_len() local
572 if (!(info->ce_mask & MACSEC_ATTR_ICV_LEN)) in rtnl_link_macsec_get_icv_len()
576 *icv_len = info->icv_len; in rtnl_link_macsec_get_icv_len()
583 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_protect() local
590 info->protect = protect; in rtnl_link_macsec_set_protect()
591 info->ce_mask |= MACSEC_ATTR_PROTECT; in rtnl_link_macsec_set_protect()
598 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_protect() local
602 if (!(info->ce_mask & MACSEC_ATTR_PROTECT)) in rtnl_link_macsec_get_protect()
606 *protect = info->protect; in rtnl_link_macsec_get_protect()
613 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_encrypt() local
620 info->encrypt = encrypt; in rtnl_link_macsec_set_encrypt()
621 info->ce_mask |= MACSEC_ATTR_ENCRYPT; in rtnl_link_macsec_set_encrypt()
628 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_encrypt() local
632 if (!(info->ce_mask & MACSEC_ATTR_ENCRYPT)) in rtnl_link_macsec_get_encrypt()
636 *encrypt = info->encrypt; in rtnl_link_macsec_get_encrypt()
643 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_encoding_sa() local
650 info->encoding_sa = encoding_sa; in rtnl_link_macsec_set_encoding_sa()
651 info->ce_mask |= MACSEC_ATTR_ENCODING_SA; in rtnl_link_macsec_set_encoding_sa()
658 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_encoding_sa() local
662 if (!(info->ce_mask & MACSEC_ATTR_ENCODING_SA)) in rtnl_link_macsec_get_encoding_sa()
666 *encoding_sa = info->encoding_sa; in rtnl_link_macsec_get_encoding_sa()
673 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_validation_type() local
680 info->validate = validate; in rtnl_link_macsec_set_validation_type()
681 info->ce_mask |= MACSEC_ATTR_VALIDATION; in rtnl_link_macsec_set_validation_type()
688 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_validation_type() local
692 if (!(info->ce_mask & MACSEC_ATTR_VALIDATION)) in rtnl_link_macsec_get_validation_type()
696 *validate = info->validate; in rtnl_link_macsec_get_validation_type()
703 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_replay_protect() local
710 info->replay_protect = replay_protect; in rtnl_link_macsec_set_replay_protect()
711 info->ce_mask |= MACSEC_ATTR_REPLAY_PROTECT; in rtnl_link_macsec_set_replay_protect()
718 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_replay_protect() local
722 if (!(info->ce_mask & MACSEC_ATTR_REPLAY_PROTECT)) in rtnl_link_macsec_get_replay_protect()
726 *replay_protect = info->replay_protect; in rtnl_link_macsec_get_replay_protect()
733 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_window() local
737 info->window = window; in rtnl_link_macsec_set_window()
738 info->ce_mask |= MACSEC_ATTR_WINDOW; in rtnl_link_macsec_set_window()
745 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_window() local
749 if (!(info->ce_mask & MACSEC_ATTR_WINDOW)) in rtnl_link_macsec_get_window()
753 *window = info->window; in rtnl_link_macsec_get_window()
760 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_send_sci() local
767 info->send_sci = send_sci; in rtnl_link_macsec_set_send_sci()
768 info->ce_mask |= MACSEC_ATTR_INC_SCI; in rtnl_link_macsec_set_send_sci()
775 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_send_sci() local
779 if (!(info->ce_mask & MACSEC_ATTR_INC_SCI)) in rtnl_link_macsec_get_send_sci()
783 *send_sci = info->send_sci; in rtnl_link_macsec_get_send_sci()
790 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_end_station() local
797 info->end_station = end_station; in rtnl_link_macsec_set_end_station()
798 info->ce_mask |= MACSEC_ATTR_ES; in rtnl_link_macsec_set_end_station()
805 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_end_station() local
809 if (!(info->ce_mask & MACSEC_ATTR_ES)) in rtnl_link_macsec_get_end_station()
813 *es = info->end_station; in rtnl_link_macsec_get_end_station()
820 struct macsec_info *info = link->l_info; in rtnl_link_macsec_set_scb() local
827 info->scb = scb; in rtnl_link_macsec_set_scb()
828 info->ce_mask |= MACSEC_ATTR_SCB; in rtnl_link_macsec_set_scb()
835 struct macsec_info *info = link->l_info; in rtnl_link_macsec_get_scb() local
839 if (!(info->ce_mask & MACSEC_ATTR_SCB)) in rtnl_link_macsec_get_scb()
843 *scb = info->scb; in rtnl_link_macsec_get_scb()