Print this page
Bayard's initial drop, needs finishing, or at least testing.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/sadb.h
          +++ new/usr/src/uts/common/inet/sadb.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _INET_SADB_H
  27   28  #define _INET_SADB_H
  28   29  
  29   30  #ifdef  __cplusplus
  30   31  extern "C" {
  31   32  #endif
  32   33  
  33   34  #include <inet/ipsec_info.h>
↓ open down ↓ 534 lines elided ↑ open up ↑
 568  569  
 569  570  /*
 570  571   * A pair of SADB's (one for v4, one for v6), and related state (including
 571  572   * acquire callbacks).
 572  573   */
 573  574  
 574  575  typedef struct sadbp_s
 575  576  {
 576  577          uint32_t        s_satype;
 577  578          uint32_t        *s_acquire_timeout;
 578      -        void            (*s_acqfn)(ipsacq_t *, mblk_t *, netstack_t *);
 579  579          sadb_t          s_v4;
 580  580          sadb_t          s_v6;
 581  581          uint32_t        s_addflags;
 582  582          uint32_t        s_updateflags;
 583  583  } sadbp_t;
 584  584  
 585  585  /*
 586  586   * A pair of SA's for a single connection, the structure contains a
 587  587   * pointer to a SA and the SA its paired with (opposite direction) as well
 588  588   * as the SA's respective hash buckets.
↓ open down ↓ 319 lines elided ↑ open up ↑
 908  908   */
 909  909  
 910  910  #define IPSEC_CTX_TMPL_ALLOC ((crypto_ctx_template_t)-1)
 911  911  #define IPSEC_CTX_TMPL(_sa, _which, _type, _tmpl) {                     \
 912  912          if ((_tmpl = (_sa)->_which) == IPSEC_CTX_TMPL_ALLOC) {          \
 913  913                  mutex_enter(&assoc->ipsa_lock);                         \
 914  914                  if ((_sa)->_which == IPSEC_CTX_TMPL_ALLOC) {            \
 915  915                          ipsec_stack_t *ipss;                            \
 916  916                                                                          \
 917  917                          ipss = assoc->ipsa_netstack->netstack_ipsec;    \
 918      -                        mutex_enter(&ipss->ipsec_alg_lock);             \
      918 +                        rw_enter(&ipss->ipsec_alg_lock, RW_READER);     \
 919  919                          (void) ipsec_create_ctx_tmpl(_sa, _type);       \
 920      -                        mutex_exit(&ipss->ipsec_alg_lock);              \
      920 +                        rw_exit(&ipss->ipsec_alg_lock);                 \
 921  921                  }                                                       \
 922  922                  mutex_exit(&assoc->ipsa_lock);                          \
 923  923                  if ((_tmpl = (_sa)->_which) == IPSEC_CTX_TMPL_ALLOC)    \
 924  924                          _tmpl = NULL;                                   \
 925  925          }                                                               \
 926  926  }
 927  927  
 928  928  extern int ipsec_create_ctx_tmpl(ipsa_t *, ipsec_algtype_t);
 929  929  extern void ipsec_destroy_ctx_tmpl(ipsa_t *, ipsec_algtype_t);
 930  930  
↓ open down ↓ 51 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX