Lines Matching refs:feat
213 static const char *dccp_feat_fname(const u8 feat) in dccp_feat_fname() argument
227 if (feat > DCCPF_DATA_CHECKSUM && feat < DCCPF_MIN_CCID_SPECIFIC) in dccp_feat_fname()
230 if (feat == DCCPF_SEND_LEV_RATE) in dccp_feat_fname()
232 if (feat >= DCCPF_MIN_CCID_SPECIFIC) in dccp_feat_fname()
235 return feature_names[feat]; in dccp_feat_fname()
288 #define dccp_feat_print_opt(opt, feat, val, len, mandatory) do { \ argument
289 dccp_pr_debug("%s(%s, ", dccp_feat_oname(opt), dccp_feat_fname(feat));\
290 dccp_feat_printvals(feat, val, len); \
301 #define dccp_feat_print_opt(opt, feat, val, len, mandatory) argument
451 dccp_feat_entry_new(struct list_head *head, u8 feat, bool local) in dccp_feat_entry_new() argument
456 if (entry->feat_num == feat && entry->is_local == local) { in dccp_feat_entry_new()
459 } else if (entry->feat_num > feat) { in dccp_feat_entry_new()
466 entry->feat_num = feat; in dccp_feat_entry_new()
481 static int dccp_feat_push_change(struct list_head *fn_list, u8 feat, u8 local, in dccp_feat_push_change() argument
484 struct dccp_feat_entry *new = dccp_feat_entry_new(fn_list, feat, local); in dccp_feat_push_change()
489 new->feat_num = feat; in dccp_feat_push_change()
509 static int dccp_feat_push_confirm(struct list_head *fn_list, u8 feat, u8 local, in dccp_feat_push_confirm() argument
512 struct dccp_feat_entry *new = dccp_feat_entry_new(fn_list, feat, local); in dccp_feat_push_confirm()
517 new->feat_num = feat; in dccp_feat_push_confirm()
530 static int dccp_push_empty_confirm(struct list_head *fn_list, u8 feat, u8 local) in dccp_push_empty_confirm() argument
532 return dccp_feat_push_confirm(fn_list, feat, local, NULL); in dccp_push_empty_confirm()
699 static int __feat_register_nn(struct list_head *fn, u8 feat, in __feat_register_nn() argument
704 if (dccp_feat_type(feat) != FEAT_NN || in __feat_register_nn()
705 !dccp_feat_is_valid_nn_val(feat, nn_val)) in __feat_register_nn()
709 if (nn_val - (u64)dccp_feat_default_value(feat) == 0) in __feat_register_nn()
712 return dccp_feat_push_change(fn, feat, 1, mandatory, &fval); in __feat_register_nn()
724 static int __feat_register_sp(struct list_head *fn, u8 feat, u8 is_local, in __feat_register_sp() argument
729 if (dccp_feat_type(feat) != FEAT_SP || in __feat_register_sp()
730 !dccp_feat_sp_list_ok(feat, sp_val, sp_len)) in __feat_register_sp()
734 if (feat == DCCPF_CCID && !ccid_support_check(sp_val, sp_len)) in __feat_register_sp()
740 if (dccp_feat_push_change(fn, feat, is_local, mandatory, &fval)) { in __feat_register_sp()
756 int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local, in dccp_feat_register_sp() argument
761 if (dccp_feat_type(feat) != FEAT_SP) in dccp_feat_register_sp()
763 return __feat_register_sp(&dccp_sk(sk)->dccps_featneg, feat, is_local, in dccp_feat_register_sp()
775 u64 dccp_feat_nn_get(struct sock *sk, u8 feat) in dccp_feat_nn_get() argument
777 if (dccp_feat_type(feat) == FEAT_NN) { in dccp_feat_nn_get()
781 entry = dccp_feat_list_lookup(&dp->dccps_featneg, feat, 1); in dccp_feat_nn_get()
785 switch (feat) { in dccp_feat_nn_get()
792 DCCP_BUG("attempt to look up unsupported feature %u", feat); in dccp_feat_nn_get()
805 int dccp_feat_signal_nn_change(struct sock *sk, u8 feat, u64 nn_val) in dccp_feat_signal_nn_change() argument
814 if (dccp_feat_type(feat) != FEAT_NN || in dccp_feat_signal_nn_change()
815 !dccp_feat_is_valid_nn_val(feat, nn_val)) in dccp_feat_signal_nn_change()
818 if (nn_val == dccp_feat_nn_get(sk, feat)) in dccp_feat_signal_nn_change()
821 entry = dccp_feat_list_lookup(fn, feat, 1); in dccp_feat_signal_nn_change()
830 return dccp_feat_push_change(fn, feat, 1, 0, &fval); in dccp_feat_signal_nn_change()
1108 u8 feat, u8 *val, u8 len, const bool server) in dccp_feat_change_recv() argument
1110 u8 defval, type = dccp_feat_type(feat); in dccp_feat_change_recv()
1118 dccp_feat_print_opt(opt, feat, val, len, is_mandatory); in dccp_feat_change_recv()
1130 if (!dccp_feat_is_valid_nn_val(feat, fval.nn)) in dccp_feat_change_recv()
1133 return dccp_feat_push_confirm(fn, feat, local, &fval); in dccp_feat_change_recv()
1139 entry = dccp_feat_list_lookup(fn, feat, local); in dccp_feat_change_recv()
1155 defval = dccp_feat_default_value(feat); in dccp_feat_change_recv()
1158 } else if (!dccp_feat_is_valid_sp_val(feat, fval.sp.vec[0])) { in dccp_feat_change_recv()
1164 if (feat == DCCPF_CCID && !ccid_support_check(fval.sp.vec, 1)) { in dccp_feat_change_recv()
1169 return dccp_feat_push_confirm(fn, feat, local, &fval); in dccp_feat_change_recv()
1189 defval = dccp_feat_default_value(feat); in dccp_feat_change_recv()
1201 return dccp_push_empty_confirm(fn, feat, local); in dccp_feat_change_recv()
1219 u8 feat, u8 *val, u8 len, const bool server) in dccp_feat_confirm_recv() argument
1221 u8 *plist, plen, type = dccp_feat_type(feat); in dccp_feat_confirm_recv()
1223 struct dccp_feat_entry *entry = dccp_feat_list_lookup(fn, feat, local); in dccp_feat_confirm_recv()
1225 dccp_feat_print_opt(opt, feat, val, len, is_mandatory); in dccp_feat_confirm_recv()
1240 if (dccp_feat_must_be_understood(feat)) /* 6.6.7 */ in dccp_feat_confirm_recv()
1269 if (!dccp_feat_is_valid_sp_val(feat, *val)) in dccp_feat_confirm_recv()
1316 u8 feat, u8 *val, u8 len) in dccp_feat_handle_nn_established() argument
1321 u8 type = dccp_feat_type(feat); in dccp_feat_handle_nn_established()
1324 dccp_feat_print_opt(opt, feat, val, len, mandatory); in dccp_feat_handle_nn_established()
1346 if (!dccp_feat_is_valid_nn_val(feat, fval.nn)) in dccp_feat_handle_nn_established()
1349 if (dccp_feat_push_confirm(fn, feat, local, &fval) || in dccp_feat_handle_nn_established()
1350 dccp_feat_activate(sk, feat, local, &fval)) in dccp_feat_handle_nn_established()
1357 entry = dccp_feat_list_lookup(fn, feat, local); in dccp_feat_handle_nn_established()
1372 dccp_feat_activate(sk, feat, local, &fval); in dccp_feat_handle_nn_established()
1385 return dccp_push_empty_confirm(fn, feat, local); in dccp_feat_handle_nn_established()
1405 u8 mandatory, u8 opt, u8 feat, u8 *val, u8 len) in dccp_feat_parse_options() argument
1422 return dccp_feat_change_recv(fn, mandatory, opt, feat, in dccp_feat_parse_options()
1426 return dccp_feat_confirm_recv(fn, mandatory, opt, feat, in dccp_feat_parse_options()
1435 return dccp_feat_handle_nn_established(sk, mandatory, opt, feat, in dccp_feat_parse_options()