Lines Matching defs:scm

108 #include <net/scm.h>
120 #include "scm.h"
188 static void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb)
190 UNIXCB(skb).secid = scm->secid;
193 static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
195 scm->secid = UNIXCB(skb).secid;
198 static inline bool unix_secdata_eq(struct scm_cookie *scm, struct sk_buff *skb)
200 return (scm->secid == UNIXCB(skb).secid);
203 static inline void unix_get_secdata(struct scm_cookie *scm, struct sk_buff *skb)
206 static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
209 static inline bool unix_secdata_eq(struct scm_cookie *scm, struct sk_buff *skb)
1775 static void unix_peek_fds(struct scm_cookie *scm, struct sk_buff *skb)
1777 scm->fp = scm_fp_dup(UNIXCB(skb).fp);
1822 static int unix_scm_to_skb(struct scm_cookie *scm, struct sk_buff *skb, bool send_fds)
1826 UNIXCB(skb).pid = get_pid(scm->pid);
1827 UNIXCB(skb).uid = scm->creds.uid;
1828 UNIXCB(skb).gid = scm->creds.gid;
1830 unix_get_secdata(scm, skb);
1831 if (scm->fp && send_fds)
1832 err = unix_attach_fds(scm, skb);
1865 struct scm_cookie *scm)
1867 return UNIXCB(skb).pid == scm->pid &&
1868 uid_eq(UNIXCB(skb).uid, scm->creds.uid) &&
1869 gid_eq(UNIXCB(skb).gid, scm->creds.gid) &&
1870 unix_secdata_eq(scm, skb);
1901 struct scm_cookie scm;
1909 err = scm_send(sock, msg, &scm, false);
1955 err = unix_scm_to_skb(&scm, skb, true);
2091 scm_destroy(&scm);
2103 scm_destroy(&scm);
2114 struct scm_cookie *scm, bool fds_sent)
2125 err = unix_scm_to_skb(scm, skb, !fds_sent);
2173 struct scm_cookie scm;
2178 err = scm_send(sock, msg, &scm, false);
2231 err = unix_scm_to_skb(&scm, skb, !fds_sent);
2274 err = queue_oob(sock, msg, other, &scm, fds_sent);
2281 scm_destroy(&scm);
2293 scm_destroy(&scm);
2340 struct scm_cookie scm;
2404 memset(&scm, 0, sizeof(scm));
2406 scm_set_cred(&scm, UNIXCB(skb).pid, UNIXCB(skb).uid, UNIXCB(skb).gid);
2407 unix_set_secdata(&scm, skb);
2411 unix_detach_fds(&scm, skb);
2431 unix_peek_fds(&scm, skb);
2435 scm_recv_unix(sock, msg, &scm, flags);
2612 struct scm_cookie scm;
2643 memset(&scm, 0, sizeof(scm));
2705 scm_destroy(&scm);
2729 if (!unix_skb_scm_eq(skb, &scm))
2734 scm_set_cred(&scm, UNIXCB(skb).pid, UNIXCB(skb).uid, UNIXCB(skb).gid);
2735 unix_set_secdata(&scm, skb);
2781 unix_detach_fds(&scm, skb);
2790 if (scm.fp)
2796 unix_peek_fds(&scm, skb);
2817 scm_recv_unix(sock, state->msg, &scm, flags);
2819 scm_destroy(&scm);