/* Description: Call the NetLabel mechanism to get the security attributes of the given packet and use those attributes to determine the correct context/SID to assign to the packet. Returns zero on success, negative values on failure.  */
int selinux_netlbl_skbuff_getsid(struct sk_buff *skb, u16 family, u32 *type, u32 *sid)
/* Description: Call the NetLabel mechanism to get the security attributes of the given packet and use those attributes to determine the correct context/SID to assign to the packet. Returns zero on success, negative values on failure.  */
int selinux_netlbl_skbuff_getsid(struct sk_buff *skb, u16 family, u32 *type, u32 *sid)
{
	int rc;
	struct netlbl_lsm_secattr secattr;
	if (!netlbl_enabled()) {
		*sid = SECSID_NULL;
		return 0;
	}
	netlbl_secattr_init(&secattr);
	rc = netlbl_skbuff_getattr(skb, family, &secattr);
	if (rc == 0 && secattr.flags != NETLBL_SECATTR_NONE)
		rc = selinux_netlbl_sidlookup_cached(skb, &secattr, sid);
	else
		*sid = SECSID_NULL;
	*type = secattr.type;
	netlbl_secattr_destroy(&secattr);
	return rc;
}