Print this page
Current snapshot of OpenSolaris port.
Checkpoint
Checkpoint
Merge from parent.
Merge with WIDE update.
Pull from WIDE.
Pull from WIDE.
Checkpoint
Re-update.
blah
WIDE update
Update from WIDE.

Split Close
Expand all
Collapse all
          --- old/iked/ikev1/ipsec_doi.c
          +++ new/iked/ikev1/ipsec_doi.c
↓ open down ↓ 35 lines elided ↑ open up ↑
  36   36  #include <sys/socket.h>
  37   37  
  38   38  #include <netinet/in.h>
  39   39  
  40   40  #ifdef HAVE_NETINET6_IPSEC_H
  41   41  # include <netinet6/ipsec.h>
  42   42  #else
  43   43  # ifdef HAVE_NETIPSEC_IPSEC_H
  44   44  #  include <netipsec/ipsec.h>
  45   45  # else
  46      -#  include <linux/ipsec.h>
       46 +#  ifndef sun   /* XXX KEBE SAYS OpenSolaris */
       47 +#    include <linux/ipsec.h>
       48 +#  endif
  47   49  # endif
  48   50  #endif
  49   51  
       52 +#ifdef sun      /* XXX KEBE SAYS OpenSolaris */
       53 +#define IPSEC_ULPROTO_ANY 0
       54 +#define IPSEC_PORT_ANY 0
       55 +#endif
       56 +
  50   57  #include <assert.h>
  51   58  #include <stdlib.h>
  52   59  #include <stdio.h>
  53   60  #include <string.h>
  54   61  #include <errno.h>
  55   62  #include <netdb.h>
  56   63  #if TIME_WITH_SYS_TIME
  57   64  # include <sys/time.h>
  58   65  # include <time.h>
  59   66  #else
↓ open down ↓ 2968 lines elided ↑ open up ↑
3028 3035   * return 1 if all of the given protocols are transport mode.
3029 3036   */
3030 3037  int
3031 3038  ipsecdoi_transportmode(pp)
3032 3039          struct saprop *pp;
3033 3040  {
3034 3041          struct saproto *pr = NULL;
3035 3042  
3036 3043          for (; pp; pp = pp->next) {
3037 3044                  for (pr = pp->head; pr; pr = pr->next) {
3038      -                        if (pr->encmode != IPSECDOI_ATTR_ENC_MODE_TRNS)
     3045 +                        if (pr->encmode != IPSECDOI_ATTR_ENC_MODE_TRNS &&
     3046 +                            pr->encmode != IPSECDOI_ATTR_ENC_MODE_UDPTRNS_RFC)
3039 3047                                  return 0;
3040 3048                  }
3041 3049          }
3042 3050  
3043 3051          return 1;
3044 3052  }
3045 3053  
3046 3054  #if 0
3047 3055  int
3048 3056  ipsecdoi_get_defaultlifetime()
↓ open down ↓ 52 lines elided ↑ open up ↑
3101 3109  
3102 3110  int
3103 3111  ipproto2doi(proto)
3104 3112          int proto;
3105 3113  {
3106 3114          switch (proto) {
3107 3115          case IPPROTO_AH:
3108 3116                  return IPSECDOI_PROTO_IPSEC_AH;
3109 3117          case IPPROTO_ESP:
3110 3118                  return IPSECDOI_PROTO_IPSEC_ESP;
     3119 +#ifndef sun     /* XXX KEBE SAYS OpenSolaris */
3111 3120          case IPPROTO_IPCOMP:
3112 3121                  return IPSECDOI_PROTO_IPCOMP;
     3122 +#endif
3113 3123          }
3114 3124          return -1;      /* XXX */
3115 3125  }
3116 3126  
3117 3127  int
3118 3128  doi2ipproto(proto)
3119 3129          int proto;
3120 3130  {
3121 3131          switch (proto) {
3122 3132          case IPSECDOI_PROTO_IPSEC_AH:
3123 3133                  return IPPROTO_AH;
3124 3134          case IPSECDOI_PROTO_IPSEC_ESP:
3125 3135                  return IPPROTO_ESP;
     3136 +#ifndef sun     /* XXX KEBE SAYS OpenSolaris */
3126 3137          case IPSECDOI_PROTO_IPCOMP:
3127 3138                  return IPPROTO_IPCOMP;
     3139 +#endif
3128 3140          }
3129 3141          return -1;      /* XXX */
3130 3142  }
3131 3143  
3132 3144  /*
3133 3145   * check the following:
3134 3146   * - In main mode with pre-shared key, only address type can be used.
3135 3147   * - if proper type for phase 1 ?
3136 3148   * - if phase 1 ID payload conformed RFC2407 4.6.2.
3137 3149   *   (proto, port) must be (0, 0), (udp, 500) or (udp, [specified]).
↓ open down ↓ 881 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX