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