/*
- * Copyright (c) 2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2008,2011 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define FIRST_NET_STR_ID 1000
static SLIST_HEAD(,net_str_id_entry) net_str_id_list = {NULL};
-static lck_mtx_t *net_str_id_lock = NULL;
+decl_lck_mtx_data(static, net_str_id_lock_data);
+static lck_mtx_t *net_str_id_lock = &net_str_id_lock_data;
static u_int32_t nsi_kind_next[NSI_MAX_KIND] = { FIRST_NET_STR_ID, FIRST_NET_STR_ID, FIRST_NET_STR_ID };
static u_int32_t nsi_next_id = FIRST_NET_STR_ID;
-#if NETMIBS
-
extern int sysctl_if_family_ids SYSCTL_HANDLER_ARGS;
SYSCTL_DECL(_net_link_generic_system);
SYSCTL_PROC(_net_link_generic_system, OID_AUTO, if_family_ids, CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_LOCKED,
0, 0, sysctl_if_family_ids, "S, if_family_id", "Interface Family ID table");
-#endif /* NETMIBS */
-
-
__private_extern__ void
net_str_id_init(void)
{
lck_grp_attr_free(grp_attrib);
lck_attrb = lck_attr_alloc_init();
- net_str_id_lock = lck_mtx_alloc_init(lck_group, lck_attrb);
+ lck_mtx_init(net_str_id_lock, lck_group, lck_attrb);
lck_grp_free(lck_group);
lck_attr_free(lck_attrb);
}
-#if NETMIBS
-
#define ROUNDUP32(a) \
((a) > 0 ? (1 + (((a) - 1) | (sizeof(uint32_t) - 1))) : sizeof(uint32_t))
_FREE(iffmid, M_TEMP);
return error;
}
-
-#endif /* NETMIBS */
-