Lines Matching defs:feat
2 * net/dccp/feat.c
27 #include "feat.h"
215 static const char *dccp_feat_fname(const u8 feat)
229 if (feat > DCCPF_DATA_CHECKSUM && feat < DCCPF_MIN_CCID_SPECIFIC)
232 if (feat == DCCPF_SEND_LEV_RATE)
234 if (feat >= DCCPF_MIN_CCID_SPECIFIC)
237 return feature_names[feat];
290 #define dccp_feat_print_opt(opt, feat, val, len, mandatory) do { \
291 dccp_pr_debug("%s(%s, ", dccp_feat_oname(opt), dccp_feat_fname(feat));\
292 dccp_feat_printvals(feat, val, len); \
303 #define dccp_feat_print_opt(opt, feat, val, len, mandatory)
432 * @feat: feature number
433 * @local: whether the local (1) or remote feature with number @feat is meant
437 dccp_feat_entry_new(struct list_head *head, u8 feat, bool local)
442 if (entry->feat_num == feat && entry->is_local == local) {
445 } else if (entry->feat_num > feat) {
452 entry->feat_num = feat;
462 * @feat: one of %dccp_feature_numbers
467 static int dccp_feat_push_change(struct list_head *fn_list, u8 feat, u8 local,
470 struct dccp_feat_entry *new = dccp_feat_entry_new(fn_list, feat, local);
475 new->feat_num = feat;
489 * @feat: one of %dccp_feature_numbers
494 static int dccp_feat_push_confirm(struct list_head *fn_list, u8 feat, u8 local,
497 struct dccp_feat_entry *new = dccp_feat_entry_new(fn_list, feat, local);
502 new->feat_num = feat;
515 static int dccp_push_empty_confirm(struct list_head *fn_list, u8 feat, u8 local)
517 return dccp_feat_push_confirm(fn_list, feat, local, NULL);
665 * @feat: an NN feature from %dccp_feature_numbers
670 static int __feat_register_nn(struct list_head *fn, u8 feat,
675 if (dccp_feat_type(feat) != FEAT_NN ||
676 !dccp_feat_is_valid_nn_val(feat, nn_val))
680 if (nn_val - (u64)dccp_feat_default_value(feat) == 0)
683 return dccp_feat_push_change(fn, feat, 1, mandatory, &fval);
689 * @feat: an SP feature from %dccp_feature_numbers
690 * @is_local: whether the local (1) or the remote (0) @feat is meant
695 static int __feat_register_sp(struct list_head *fn, u8 feat, u8 is_local,
700 if (dccp_feat_type(feat) != FEAT_SP ||
701 !dccp_feat_sp_list_ok(feat, sp_val, sp_len))
705 if (feat == DCCPF_CCID && !ccid_support_check(sp_val, sp_len))
711 return dccp_feat_push_change(fn, feat, is_local, mandatory, &fval);
717 * @feat: one of %dccp_feature_numbers
718 * @is_local: whether the local (1) or remote (0) @feat is meant
722 int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local,
727 if (dccp_feat_type(feat) != FEAT_SP)
729 return __feat_register_sp(&dccp_sk(sk)->dccps_featneg, feat, is_local,
734 int dccp_feat_register_nn(struct sock *sk, u8 feat, u64 val)
739 if (dccp_feat_type(feat) != FEAT_NN)
741 return __feat_register_nn(&dccp_sk(sk)->dccps_featneg, feat, 0, val);
1004 * @feat: one of %dccp_feature_numbers
1010 u8 feat, u8 *val, u8 len, const bool server)
1012 u8 defval, type = dccp_feat_type(feat);
1020 dccp_feat_print_opt(opt, feat, val, len, is_mandatory);
1032 if (!dccp_feat_is_valid_nn_val(feat, fval.nn))
1035 return dccp_feat_push_confirm(fn, feat, local, &fval);
1041 entry = dccp_feat_list_lookup(fn, feat, local);
1057 defval = dccp_feat_default_value(feat);
1060 } else if (!dccp_feat_is_valid_sp_val(feat, fval.sp.vec[0])) {
1066 if (feat == DCCPF_CCID && !ccid_support_check(fval.sp.vec, 1)) {
1071 return dccp_feat_push_confirm(fn, feat, local, &fval);
1085 * value for @feat. If yes, send an empty Confirm to signal that
1091 defval = dccp_feat_default_value(feat);
1103 return dccp_push_empty_confirm(fn, feat, local);
1115 * @feat: one of %dccp_feature_numbers
1121 u8 feat, u8 *val, u8 len, const bool server)
1123 u8 *plist, plen, type = dccp_feat_type(feat);
1125 struct dccp_feat_entry *entry = dccp_feat_list_lookup(fn, feat, local);
1127 dccp_feat_print_opt(opt, feat, val, len, is_mandatory);
1142 if (dccp_feat_must_be_understood(feat)) /* 6.6.7 */
1171 if (!dccp_feat_is_valid_sp_val(feat, *val))
1205 * @feat: one of %dccp_feature_numbers
1211 u8 mandatory, u8 opt, u8 feat, u8 *val, u8 len)
1227 return dccp_feat_change_recv(fn, mandatory, opt, feat,
1231 return dccp_feat_confirm_recv(fn, mandatory, opt, feat,