tells how many processes the UDP layer will create */
| 65 | |
| 66 | /* tells how many processes the UDP layer will create */ |
| 67 | int udp_count_processes(unsigned int *extra) |
| 68 | { |
| 69 | struct socket_info_full *sif; |
| 70 | unsigned int n, e, i; |
| 71 | |
| 72 | if (udp_disabled) { |
| 73 | if (extra) *extra = 0; |
| 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | for( i=0,n=0,e=0 ; i<PROTO_LAST ; i++) |
| 78 | if (protos[i].id!=PROTO_NONE && is_udp_based_proto(i)) |
| 79 | for( sif=protos[i].listeners ; sif; sif=sif->next) { |
| 80 | const struct socket_info *si = &sif->socket_info; |
| 81 | n+=si->workers; |
| 82 | if (si->s_profile) |
| 83 | if (si->s_profile->max_procs > si->workers) |
| 84 | e+=si->s_profile->max_procs-si->workers; |
| 85 | } |
| 86 | |
| 87 | if (extra) *extra = e; |
| 88 | return n; |
| 89 | } |
| 90 | |
| 91 | #ifdef USE_MCAST |
| 92 | /** |
no outgoing calls
no test coverage detected