1 /*
   2  * This file and its contents are supplied under the terms of the
   3  * Common Development and Distribution License ("CDDL"), version 1.0.
   4  * You may only use this file in accordance with the terms of version
   5  * 1.0 of the CDDL.
   6  *
   7  * A full copy of the text of the CDDL should have accompanied this
   8  * source.  A copy of the CDDL is also available via the Internet at
   9  * http://www.illumos.org/license/CDDL.
  10  */
  11 
  12 /*
  13  * Copyright 2012 David Hoeppner. All rights reserved.
  14  */
  15 
  16 #include <sys/types.h> 
  17 #include <sys/stream.h> 
  18 #include <sys/debug.h> 
  19 #include <sys/cmn_err.h>
  20 #include <inet/dccp_impl.h>
  21 #include <inet/dccp_stack.h>
  22 
  23 /*
  24  * This file contains functions to parse and process DCCP features.
  25  */
  26 
  27 /*
  28  * Feature handling.
  29  */
  30 void
  31 dccp_parse_feature(dccp_t *dccp, uint8_t option, uint8_t length, uchar_t *up,
  32     boolean_t mandatory)
  33 {
  34         dccp_feature_t  *feature;
  35         uint8_t         feature_type;
  36         uint8_t         feature_length = length - 1;
  37 
  38         cmn_err(CE_NOTE, "dccp_features.c: dccp_parse_feature");
  39 
  40         feature_type = *up;
  41 
  42         switch (feature_type) {
  43         case DCCP_FEATURE_CCID:
  44                 cmn_err(CE_NOTE, "DCCP_FEATURE_CCID");
  45                 break;
  46         case DCCP_FEATURE_ALLOW_SHORT_SEQNOS:
  47                 cmn_err(CE_NOTE, "DCCP_FEATURE_ALLOW_SHORT_SEQNOS");
  48                 break;
  49         case DCCP_FEATURE_SEQUENCE_WINDOW:
  50                 cmn_err(CE_NOTE, "DCCP_FEATURE_SEQUENCE_WINDOW");
  51                 break;
  52         case DCCP_FEATURE_ECN_INCAPABLE:
  53                 cmn_err(CE_NOTE, "DCCP_FEATURE_ECN_INCAPABLE");
  54                 break;
  55         case DCCP_FEATURE_ACK_RATIO:
  56                 cmn_err(CE_NOTE, "DCCP_FEATURE_ACK_RATIO");
  57                 break;
  58         case DCCP_FEATURE_SEND_ACK_VECTOR:
  59                 cmn_err(CE_NOTE, "DCCP_FEATURE_SEND_ACK_VECTOR");
  60                 break;
  61         case DCCP_FEATURE_SEND_NDP_COUNT:
  62                 cmn_err(CE_NOTE, "DCCP_FEATURE_SEND_NDP_COUNT");
  63                 break;
  64         case DCCP_FEATURE_MIN_CHECKSUM_COVERAGE:
  65                 cmn_err(CE_NOTE, "DCCP_FEATURE_MIN_CHECKSUM_COVERAGE");
  66                 break;
  67         case DCCP_FEATURE_CHECK_DATA_CHECKSUM:
  68                 cmn_err(CE_NOTE, "DCCP_FEATURE_CHECK_DATA_CHECKSUM");
  69                 break;
  70 
  71         default:
  72                 cmn_err(CE_NOTE, "ERROR DEFAULT");
  73                 break;
  74         }
  75 
  76         cmn_err(CE_NOTE, "feature len: %d", feature_length);
  77 
  78         feature = (dccp_feature_t *)kmem_alloc(sizeof (dccp_feature_t),
  79             KM_SLEEP);
  80         if (feature == NULL) {
  81                 return;
  82         }
  83 
  84         feature->df_option = option;
  85         feature->df_type = feature_type;
  86         feature->df_mandatory = mandatory;
  87 
  88         list_insert_tail(&dccp->dccp_features, feature);
  89 }
  90 
  91 void
  92 dccp_features_init(void)
  93 {
  94 }
  95 
  96 void
  97 dccp_features_destroy(void)
  98 {
  99 }