Print this page
dccp: starting module template

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/ip.c
          +++ new/usr/src/uts/common/inet/ip/ip.c
↓ open down ↓ 103 lines elided ↑ open up ↑
 104  104  
 105  105  #include <sys/ethernet.h>
 106  106  #include <net/if_types.h>
 107  107  #include <sys/cpuvar.h>
 108  108  
 109  109  #include <ipp/ipp.h>
 110  110  #include <ipp/ipp_impl.h>
 111  111  #include <ipp/ipgpc/ipgpc.h>
 112  112  
 113  113  #include <sys/pattr.h>
      114 +#include <inet/dccp.h>
      115 +#include <inet/dccp_impl.h>
      116 +#include <inet/dccp_ip.h>
 114  117  #include <inet/ipclassifier.h>
 115  118  #include <inet/sctp_ip.h>
 116  119  #include <inet/sctp/sctp_impl.h>
 117  120  #include <inet/udp_impl.h>
 118  121  #include <inet/rawip_impl.h>
 119  122  #include <inet/rts_impl.h>
 120  123  
 121  124  #include <sys/tsol/label.h>
 122  125  #include <sys/tsol/tnet.h>
 123  126  
↓ open down ↓ 4180 lines elided ↑ open up ↑
4304 4307          /* This needs to be called before destroying any transports. */
4305 4308          mutex_enter(&cpu_lock);
4306 4309          unregister_cpu_setup_func(ip_tp_cpu_update, NULL);
4307 4310          mutex_exit(&cpu_lock);
4308 4311  
4309 4312          tnet_fini();
4310 4313  
4311 4314          icmp_ddi_g_destroy();
4312 4315          rts_ddi_g_destroy();
4313 4316          udp_ddi_g_destroy();
     4317 +        dccp_ddi_g_destroy();
4314 4318          sctp_ddi_g_destroy();
4315 4319          tcp_ddi_g_destroy();
4316 4320          ilb_ddi_g_destroy();
4317 4321          dce_g_destroy();
4318 4322          ipsec_policy_g_destroy();
4319 4323          ipcl_g_destroy();
4320 4324          ip_net_g_destroy();
4321 4325          ip_ire_g_fini();
4322 4326          inet_minor_destroy(ip_minor_arena_sa);
4323 4327  #if defined(_LP64)
↓ open down ↓ 216 lines elided ↑ open up ↑
4540 4544  
4541 4545  #ifdef DEBUG
4542 4546          tsd_create(&ip_thread_data, ip_thread_exit);
4543 4547          rw_init(&ip_thread_rwlock, NULL, RW_DEFAULT, NULL);
4544 4548          list_create(&ip_thread_list, sizeof (th_hash_t),
4545 4549              offsetof(th_hash_t, thh_link));
4546 4550  #endif
4547 4551          ipsec_policy_g_init();
4548 4552          tcp_ddi_g_init();
4549 4553          sctp_ddi_g_init();
     4554 +        dccp_ddi_g_init();
4550 4555          dce_g_init();
4551 4556  
4552 4557          /*
4553 4558           * We want to be informed each time a stack is created or
4554 4559           * destroyed in the kernel, so we can maintain the
4555 4560           * set of udp_stack_t's.
4556 4561           */
4557 4562          netstack_register(NS_IP, ip_stack_init, ip_stack_shutdown,
4558 4563              ip_stack_fini);
4559 4564  
↓ open down ↓ 5117 lines elided ↑ open up ↑
9677 9682          if (mpctl == NULL)
9678 9683                  return (1);
9679 9684  
9680 9685          mpctl = ip_snmp_get_mib2_ip6_route_media(q, mpctl, level, ipst);
9681 9686          if (mpctl == NULL)
9682 9687                  return (1);
9683 9688  
9684 9689          if ((mpctl = sctp_snmp_get_mib2(q, mpctl, sctps)) == NULL) {
9685 9690                  return (1);
9686 9691          }
     9692 +
9687 9693          if ((mpctl = ip_snmp_get_mib2_ip_dce(q, mpctl, ipst)) == NULL) {
9688 9694                  return (1);
9689 9695          }
     9696 +
     9697 +        if ((mpctl = dccp_snmp_get(q, mpctl, legacy_req)) == NULL) {
     9698 +                return (1);
     9699 +        }
     9700 +
9690 9701          freemsg(mpctl);
9691 9702          return (1);
9692 9703  }
9693 9704  
9694 9705  /* Get global (legacy) IPv4 statistics */
9695 9706  static mblk_t *
9696 9707  ip_snmp_get_mib2_ip(queue_t *q, mblk_t *mpctl, mib2_ipIfStatsEntry_t *ipmib,
9697 9708      ip_stack_t *ipst, boolean_t legacy_req)
9698 9709  {
9699 9710          mib2_ip_t               old_ip_mib;
↓ open down ↓ 5530 lines elided ↑ open up ↑
15230 15241          ASSERT(MUTEX_HELD(&cpu_lock));
15231 15242  
15232 15243          switch (what) {
15233 15244          case CPU_CONFIG:
15234 15245          case CPU_ON:
15235 15246          case CPU_INIT:
15236 15247          case CPU_CPUPART_IN:
15237 15248                  cpu_seqid = cpu[id]->cpu_seqid;
15238 15249                  netstack_next_init(&nh);
15239 15250                  while ((ns = netstack_next(&nh)) != NULL) {
     15251 +                        dccp_stack_cpu_add(ns->netstack_dccp, cpu_seqid);
15240 15252                          tcp_stack_cpu_add(ns->netstack_tcp, cpu_seqid);
15241 15253                          sctp_stack_cpu_add(ns->netstack_sctp, cpu_seqid);
15242 15254                          udp_stack_cpu_add(ns->netstack_udp, cpu_seqid);
15243 15255                          netstack_rele(ns);
15244 15256                  }
15245 15257                  netstack_next_fini(&nh);
15246 15258                  break;
15247 15259          case CPU_UNCONFIG:
15248 15260          case CPU_OFF:
15249 15261          case CPU_CPUPART_OUT:
15250 15262                  /*
15251 15263                   * Nothing to do.  We don't remove the per CPU stats from
15252 15264                   * the IP stack even when the CPU goes offline.
15253 15265                   */
15254 15266                  break;
15255 15267          default:
15256 15268                  break;
15257 15269          }
15258 15270          return (0);
15259 15271  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX