diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-25 20:39:55 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-25 20:39:55 -0400 |
| commit | 7e4720201ad44ace85a443f41d668a62a737e7d0 (patch) | |
| tree | 8b9118dffcfd9511d9ce31b87776e04095f9acf1 /net/netlabel/netlabel_user.c | |
| parent | 7b29122f9ec54db5c38a66a11127d94db0817c17 (diff) | |
| parent | 4cc6773508299377099aa30cf30e6a2196c5872d (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[NetLabel]: update docs with website information
[NetLabel]: rework the Netlink attribute handling (part 2)
[NetLabel]: rework the Netlink attribute handling (part 1)
[Netlink]: add nla_validate_nested()
[NETLINK]: add nla_for_each_nested() to the interface list
[NetLabel]: change the SELinux permissions
[NetLabel]: make the CIPSOv4 cache spinlocks bottom half safe
[NetLabel]: correct improper handling of non-NetLabel peer contexts
[TCP]: make cubic the default
[TCP]: default congestion control menu
[ATM] he: Fix __init/__devinit conflict
[NETFILTER]: Add dscp,DSCP headers to header-y
[DCCP]: Introduce dccp_probe
[DCCP]: Use constants for CCIDs
[DCCP]: Introduce constants for CCID numbers
[DCCP]: Allow default/fallback service code.
Diffstat (limited to 'net/netlabel/netlabel_user.c')
| -rw-r--r-- | net/netlabel/netlabel_user.c | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/net/netlabel/netlabel_user.c b/net/netlabel/netlabel_user.c index 73cbe66e42ff..eeb7d768d2bb 100644 --- a/net/netlabel/netlabel_user.c +++ b/net/netlabel/netlabel_user.c | |||
| @@ -74,85 +74,3 @@ int netlbl_netlink_init(void) | |||
| 74 | 74 | ||
| 75 | return 0; | 75 | return 0; |
| 76 | } | 76 | } |
| 77 | |||
| 78 | /* | ||
| 79 | * NetLabel Common Protocol Functions | ||
| 80 | */ | ||
| 81 | |||
| 82 | /** | ||
| 83 | * netlbl_netlink_send_ack - Send an ACK message | ||
| 84 | * @info: the generic NETLINK information | ||
| 85 | * @genl_family: the generic NETLINK family ID value | ||
| 86 | * @ack_cmd: the generic NETLINK family ACK command value | ||
| 87 | * @ret_code: return code to use | ||
| 88 | * | ||
| 89 | * Description: | ||
| 90 | * This function sends an ACK message to the sender of the NETLINK message | ||
| 91 | * specified by @info. | ||
| 92 | * | ||
| 93 | */ | ||
| 94 | void netlbl_netlink_send_ack(const struct genl_info *info, | ||
| 95 | u32 genl_family, | ||
| 96 | u8 ack_cmd, | ||
| 97 | u32 ret_code) | ||
| 98 | { | ||
| 99 | size_t data_size; | ||
| 100 | struct sk_buff *skb; | ||
| 101 | |||
| 102 | data_size = GENL_HDRLEN + 2 * NETLBL_LEN_U32; | ||
| 103 | skb = netlbl_netlink_alloc_skb(0, data_size, GFP_KERNEL); | ||
| 104 | if (skb == NULL) | ||
| 105 | return; | ||
| 106 | |||
| 107 | if (netlbl_netlink_hdr_put(skb, | ||
| 108 | info->snd_pid, | ||
| 109 | 0, | ||
| 110 | genl_family, | ||
| 111 | ack_cmd) == NULL) | ||
| 112 | goto send_ack_failure; | ||
| 113 | |||
| 114 | if (nla_put_u32(skb, NLA_U32, info->snd_seq) != 0) | ||
| 115 | goto send_ack_failure; | ||
| 116 | if (nla_put_u32(skb, NLA_U32, ret_code) != 0) | ||
| 117 | goto send_ack_failure; | ||
| 118 | |||
| 119 | netlbl_netlink_snd(skb, info->snd_pid); | ||
| 120 | return; | ||
| 121 | |||
| 122 | send_ack_failure: | ||
| 123 | kfree_skb(skb); | ||
| 124 | } | ||
| 125 | |||
| 126 | /* | ||
| 127 | * NETLINK I/O Functions | ||
| 128 | */ | ||
| 129 | |||
| 130 | /** | ||
| 131 | * netlbl_netlink_snd - Send a NetLabel message | ||
| 132 | * @skb: NetLabel message | ||
| 133 | * @pid: destination PID | ||
| 134 | * | ||
| 135 | * Description: | ||
| 136 | * Sends a unicast NetLabel message over the NETLINK socket. | ||
| 137 | * | ||
| 138 | */ | ||
| 139 | int netlbl_netlink_snd(struct sk_buff *skb, u32 pid) | ||
| 140 | { | ||
| 141 | return genlmsg_unicast(skb, pid); | ||
| 142 | } | ||
| 143 | |||
| 144 | /** | ||
| 145 | * netlbl_netlink_snd - Send a NetLabel message | ||
| 146 | * @skb: NetLabel message | ||
| 147 | * @pid: sending PID | ||
| 148 | * @group: multicast group id | ||
| 149 | * | ||
| 150 | * Description: | ||
| 151 | * Sends a multicast NetLabel message over the NETLINK socket to all members | ||
| 152 | * of @group except @pid. | ||
| 153 | * | ||
| 154 | */ | ||
| 155 | int netlbl_netlink_snd_multicast(struct sk_buff *skb, u32 pid, u32 group) | ||
| 156 | { | ||
| 157 | return genlmsg_multicast(skb, pid, group, GFP_KERNEL); | ||
| 158 | } | ||
