Lines Matching refs:feat

3  *  net/dccp/feat.c
23 #include "feat.h"
213 static const char *dccp_feat_fname(const u8 feat)
227 if (feat > DCCPF_DATA_CHECKSUM && feat < DCCPF_MIN_CCID_SPECIFIC)
230 if (feat == DCCPF_SEND_LEV_RATE)
232 if (feat >= DCCPF_MIN_CCID_SPECIFIC)
235 return feature_names[feat];
288 #define dccp_feat_print_opt(opt, feat, val, len, mandatory) do { \
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)
445 * @feat: feature number
446 * @local: whether the local (1) or remote feature with number @feat is meant
451 dccp_feat_entry_new(struct list_head *head, u8 feat, bool local)
456 if (entry->feat_num == feat && entry->is_local == local) {
459 } else if (entry->feat_num > feat) {
466 entry->feat_num = feat;
476 * @feat: one of %dccp_feature_numbers
481 static int dccp_feat_push_change(struct list_head *fn_list, u8 feat, u8 local,
484 struct dccp_feat_entry *new = dccp_feat_entry_new(fn_list, feat, local);
489 new->feat_num = feat;
503 * @feat: one of %dccp_feature_numbers
509 static int dccp_feat_push_confirm(struct list_head *fn_list, u8 feat, u8 local,
512 struct dccp_feat_entry *new = dccp_feat_entry_new(fn_list, feat, local);
517 new->feat_num = feat;
530 static int dccp_push_empty_confirm(struct list_head *fn_list, u8 feat, u8 local)
532 return dccp_feat_push_confirm(fn_list, feat, local, NULL);
693 * @feat: an NN feature from %dccp_feature_numbers
699 static int __feat_register_nn(struct list_head *fn, u8 feat,
704 if (dccp_feat_type(feat) != FEAT_NN ||
705 !dccp_feat_is_valid_nn_val(feat, nn_val))
709 if (nn_val - (u64)dccp_feat_default_value(feat) == 0)
712 return dccp_feat_push_change(fn, feat, 1, mandatory, &fval);
718 * @feat: an SP feature from %dccp_feature_numbers
719 * @is_local: whether the local (1) or the remote (0) @feat is meant
724 static int __feat_register_sp(struct list_head *fn, u8 feat, u8 is_local,
729 if (dccp_feat_type(feat) != FEAT_SP ||
730 !dccp_feat_sp_list_ok(feat, sp_val, sp_len))
734 if (feat == DCCPF_CCID && !ccid_support_check(sp_val, sp_len))
740 if (dccp_feat_push_change(fn, feat, is_local, mandatory, &fval)) {
751 * @feat: one of %dccp_feature_numbers
752 * @is_local: whether the local (1) or remote (0) @feat is meant
756 int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local,
761 if (dccp_feat_type(feat) != FEAT_SP)
763 return __feat_register_sp(&dccp_sk(sk)->dccps_featneg, feat, is_local,
770 * @feat: NN feature number from %dccp_feature_numbers
775 u64 dccp_feat_nn_get(struct sock *sk, u8 feat)
777 if (dccp_feat_type(feat) == FEAT_NN) {
781 entry = dccp_feat_list_lookup(&dp->dccps_featneg, feat, 1);
785 switch (feat) {
792 DCCP_BUG("attempt to look up unsupported feature %u", feat);
800 * @feat: NN feature number from %dccp_feature_numbers
805 int dccp_feat_signal_nn_change(struct sock *sk, u8 feat, u64 nn_val)
814 if (dccp_feat_type(feat) != FEAT_NN ||
815 !dccp_feat_is_valid_nn_val(feat, nn_val))
818 if (nn_val == dccp_feat_nn_get(sk, feat))
821 entry = dccp_feat_list_lookup(fn, feat, 1);
830 return dccp_feat_push_change(fn, feat, 1, 0, &fval);
1102 * @feat: one of %dccp_feature_numbers
1108 u8 feat, u8 *val, u8 len, const bool server)
1110 u8 defval, type = dccp_feat_type(feat);
1118 dccp_feat_print_opt(opt, feat, val, len, is_mandatory);
1130 if (!dccp_feat_is_valid_nn_val(feat, fval.nn))
1133 return dccp_feat_push_confirm(fn, feat, local, &fval);
1139 entry = dccp_feat_list_lookup(fn, feat, local);
1155 defval = dccp_feat_default_value(feat);
1158 } else if (!dccp_feat_is_valid_sp_val(feat, fval.sp.vec[0])) {
1164 if (feat == DCCPF_CCID && !ccid_support_check(fval.sp.vec, 1)) {
1169 return dccp_feat_push_confirm(fn, feat, local, &fval);
1183 * value for @feat. If yes, send an empty Confirm to signal that
1189 defval = dccp_feat_default_value(feat);
1201 return dccp_push_empty_confirm(fn, feat, local);
1213 * @feat: one of %dccp_feature_numbers
1219 u8 feat, u8 *val, u8 len, const bool server)
1221 u8 *plist, plen, type = dccp_feat_type(feat);
1223 struct dccp_feat_entry *entry = dccp_feat_list_lookup(fn, feat, local);
1225 dccp_feat_print_opt(opt, feat, val, len, is_mandatory);
1240 if (dccp_feat_must_be_understood(feat)) /* 6.6.7 */
1269 if (!dccp_feat_is_valid_sp_val(feat, *val))
1302 * @feat: NN number, one of %dccp_feature_numbers
1316 u8 feat, u8 *val, u8 len)
1321 u8 type = dccp_feat_type(feat);
1324 dccp_feat_print_opt(opt, feat, val, len, mandatory);
1346 if (!dccp_feat_is_valid_nn_val(feat, fval.nn))
1349 if (dccp_feat_push_confirm(fn, feat, local, &fval) ||
1350 dccp_feat_activate(sk, feat, local, &fval))
1357 entry = dccp_feat_list_lookup(fn, feat, local);
1372 dccp_feat_activate(sk, feat, local, &fval);
1385 return dccp_push_empty_confirm(fn, feat, local);
1398 * @feat: one of %dccp_feature_numbers
1405 u8 mandatory, u8 opt, u8 feat, u8 *val, u8 len)
1422 return dccp_feat_change_recv(fn, mandatory, opt, feat,
1426 return dccp_feat_confirm_recv(fn, mandatory, opt, feat,
1435 return dccp_feat_handle_nn_established(sk, mandatory, opt, feat,