PERFORCE change 100713 for review

Robert Watson rwatson at FreeBSD.org
Thu Jul 6 10:30:36 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=100713

Change 100713 by rwatson at rwatson_zoo on 2006/07/06 10:29:53

	More renaming and cleanup:
	
	- inpcb's are always created from sockets, so decomplicate name.
	- Move some mbuf operations to being netinet operations; rename.
	- Simplify ipq names.
	- Simplify sysv* names.
	- Remove mount_fs label since it's unused in practice.

Affected files ...

.. //depot/projects/trustedbsd/mac2/sys/sys/mac_framework.h#6 edit
.. //depot/projects/trustedbsd/mac2/sys/sys/mac_policy.h#13 edit

Differences ...

==== //depot/projects/trustedbsd/mac2/sys/sys/mac_framework.h#6 (text+ko) ====

@@ -131,7 +131,7 @@
 
 int	mac_inpcb_init(struct inpcb *, int flag);
 void	mac_inpcb_destroy_inpcb(struct inpcb *);
-void	mac_inpcb_create_from_socket(struct socket *so, struct inpcb *inp);
+void	mac_inpcb_create(struct socket *so, struct inpcb *inp);
 void	mac_inpcb_create_mbuf(struct inpcb *inp, struct mbuf *m);
 void	mac_inpcb_sosetlabel(struct socket *so, struct inpcb *inp);
 int	mac_inpcb_check_inpcb_deliver(struct inpcb *inp, struct mbuf *m);
@@ -139,8 +139,8 @@
 int	mac_ipq_init(struct ipq *, int flag);
 void	mac_ipq_destroy(struct ipq *);
 void	mac_ipq_create(struct mbuf *fragment, struct ipq *ipq);
-void	mac_ipq_create_datagram(struct ipq *ipq, struct mbuf *datagram);
-int	mac_ipq_fragment_match(struct mbuf *fragment, struct ipq *ipq);
+void	mac_ipq_reassemble(struct ipq *ipq, struct mbuf *datagram);
+int	mac_ipq_match(struct mbuf *fragment, struct ipq *ipq);
 void	mac_ipq_update(struct mbuf *fragment, struct ipq *ipq);
 
 int	mac_kenv_check_dump(struct ucred *cred);
@@ -167,16 +167,17 @@
 void	mac_mbuf_copy(struct mbuf *m_from, struct mbuf *m_to);
 void	mac_mbuf_tag_copy(struct m_tag *, struct m_tag *);
 void	mac_mbuf_tag_destroy(struct m_tag *);
-void	mac_mbuf_create_fragment(struct mbuf *datagram, struct mbuf *fragment);
 void	mac_mbuf_create_netlayer(struct mbuf *oldmbuf, struct mbuf *newmbuf);
-void	mac_mbuf_reflect_icmp(struct mbuf *m);
-void	mac_mbuf_reflect_tcp(struct mbuf *m);
 
 void	mac_mount_init(struct mount *);
 void	mac_mount_destroy(struct mount *);
 void	mac_mount_create(struct ucred *cred, struct mount *mp);
 int	mac_mount_check_stat(struct ucred *cred, struct mount *mp);
 
+void	mac_netinet_fragment(struct mbuf *datagram, struct mbuf *fragment);
+void	mac_netinet_icmp_reply(struct mbuf *m);
+void	mac_netinet_tcp_reply(struct mbuf *m);
+
 void	mac_pipe_init(struct pipepair *);
 void	mac_pipe_destroy(struct pipepair *);
 void	mac_pipe_create(struct ucred *cred, struct pipepair *pp);
@@ -261,40 +262,41 @@
 int	mac_socket_setsockopt_label(struct ucred *cred, struct socket *so,
 	    struct mac *extmac);
 
-void	mac_init_sysv_msgqueue(struct msqid_kernel*);
-void	mac_destroy_sysv_msgqueue(struct msqid_kernel *);
-void	mac_cleanup_sysv_msgmsg(struct msg *msgptr);
-void	mac_cleanup_sysv_msgqueue(struct msqid_kernel *msqkptr);
-void	mac_create_sysv_msgmsg(struct ucred *cred,
+void	mac_sysv_msq_init(struct msqid_kernel*);
+void	mac_sysv_msq_destroy(struct msqid_kernel *);
+void	mac_sysv_msq_cleanup(struct msqid_kernel *msqkptr);
+void	mac_sysv_msq_create_msg(struct ucred *cred,
 	    struct msqid_kernel *msqkptr, struct msg *msgptr);
-void	mac_create_sysv_msgqueue(struct ucred *cred,
+void	mac_sysv_msq_create(struct ucred *cred,
 	    struct msqid_kernel *msqkptr);
-void	mac_init_sysv_msgmsg(struct msg *);
-void	mac_destroy_sysv_msgmsg(struct msg *);
-int	mac_check_sysv_msgmsq(struct ucred *cred, struct msg *msgptr,
+int	mac_sysv_msq_check_msgmsq(struct ucred *cred, struct msg *msgptr,
 	    struct msqid_kernel *msqkptr);
-int	mac_check_sysv_msgrcv(struct ucred *cred, struct msg *msgptr);
-int	mac_check_sysv_msgrmid(struct ucred *cred, struct msg *msgptr);
-int	mac_check_sysv_msqget(struct ucred *cred,
+int	mac_sysv_msq_check_msgrcv(struct ucred *cred, struct msg *msgptr);
+int	mac_sysv_msq_check_msgrmid(struct ucred *cred, struct msg *msgptr);
+int	mac_sysv_msq_check_msqget(struct ucred *cred,
 	    struct msqid_kernel *msqkptr);
-int	mac_check_sysv_msqsnd(struct ucred *cred,
+int	mac_sysv_msq_check_msqsnd(struct ucred *cred,
 	    struct msqid_kernel *msqkptr);
-int	mac_check_sysv_msqrcv(struct ucred *cred,
+int	mac_sysv_msq_check_msqrcv(struct ucred *cred,
 	    struct msqid_kernel *msqkptr);
-int	mac_check_sysv_msqctl(struct ucred *cred,
+int	mac_sysv_msq_check_msqctl(struct ucred *cred,
 	    struct msqid_kernel *msqkptr, int cmd);
 
-void	mac_init_sysv_sem(struct semid_kernel*);
-void	mac_destroy_sysv_sem(struct semid_kernel *);
-void	mac_create_sysv_sem(struct ucred *cred,
+void	mac_sysv_msg_init(struct msg *);
+void	mac_sysv_msg_destroy(struct msg *);
+void	mac_sysv_msg_cleanup(struct msg *msgptr);
+
+void	mac_sysv_sem_init(struct semid_kernel*);
+void	mac_sysv_sem_destroy(struct semid_kernel *);
+void	mac_sysv_sem_create(struct ucred *cred,
 	    struct semid_kernel *semakptr);
-void	mac_cleanup_sysv_sem(struct semid_kernel *semakptr);
-int	mac_check_sysv_semctl(struct ucred *cred,
+void	mac_sysv_sem_cleanup_sysv_sem(struct semid_kernel *semakptr);
+int	mac_sysv_sem_check_semctl(struct ucred *cred,
 	    struct semid_kernel *semakptr, int cmd);
-int	mac_check_sysv_semget(struct ucred *cred,
+int	mac_sysv_sem_check_semget(struct ucred *cred,
 	   struct semid_kernel *semakptr);
-int	mac_check_sysv_semop(struct ucred *cred,struct semid_kernel *semakptr,
-	    size_t accesstype);
+int	mac_sysv_sem_check_semop(struct ucred *cred,
+	    struct semid_kernel *semakptr, size_t accesstype);
 
 void	mac_sysv_shm_init(struct shmid_kernel*);
 void	mac_sysv_shm_destroy(struct shmid_kernel *);

==== //depot/projects/trustedbsd/mac2/sys/sys/mac_policy.h#13 (text+ko) ====

@@ -671,10 +671,6 @@
 	mpo_bpfdesc_create_mbuf_t		mpo_bpfdesc_create_mbuf;
 	mpo_bpfdesc_check_receive_t		mpo_bpfdesc_check_receive;
 
-	/*
-	 * XXXRW: Naming consistency here -- perhaps should just be
-	 * mpo_devfs_*.
-	 */
 	mpo_devfs_init_label_t			mpo_devfs_init_label;
 	mpo_devfs_destroy_label_t		mpo_devfs_destroy_label;
 	mpo_devfs_vnode_associate_t		mpo_devfs_vnode_associate;
@@ -718,15 +714,11 @@
 	mpo_inpcb_sosetlabel_t			mpo_inpcb_sosetlabel;
 	mpo_inpcb_check_deliver_t		mpo_inpcb_check_deliver;
 
-	/*
-	 * XXXRW: Maybe s/create_datagram/reassemble/,
-	 * s/fragment_match/match/.
-	 */
 	mpo_ipq_init_label_t			mpo_ipq_init_label;
 	mpo_ipq_destroy_label_t			mpo_ipq_destroy_label;
 	mpo_ipq_create_t			mpo_ipq_create;
-	mpo_ipq_create_datagram_t		mpo_ipq_create_datagram;
-	mpo_ipq_fragment_match_t		mpo_ipq_fragment_match;
+	mpo_ipq_reassemble_t			mpo_ipq_reassemble;
+	mpo_ipq_match_t				mpo_ipq_match;
 	mpo_ipq_update_t			mpo_ipq_update;
 
 	mpo_kenv_check_dump_t			mpo_kenv_check_dump;
@@ -754,30 +746,22 @@
 	mpo_posix_sem_check_wait_t		mpo_posix_sem_check_wait;
 
 	/*
-	 * XXXRW: Perhaps fragment, netlayer, icmp, tcp, etc, should be
-	 * netinet calls rather than mbuf calls?
+	 * XXXRW: netlayer call is too generic.
 	 */
 	mpo_mbuf_init_label_t			mpo_mbuf_init_label;
 	mpo_mbuf_destroy_label_t		mpo_mbuf_destroy_label;
 	mpo_mbuf_copy_label_t			mpo_mbuf_copy_label;
-	mpo_mbuf_create_fragment_t		mpo_mbuf_create_fragment;
 	mpo_mbuf_create_netlayer_t		mpo_mbuf_create_netlayer;
-	mpo_mbuf_reflect_icmp_t			mpo_mbuf_reflect_icmp;
-	mpo_mbuf_reflect_tcp_t			mpo_mbuf_reflect_tcp;
 
-	/*
-	 * XXXRW: Time to toast mount_fs label since it basically is unused?
-	 */
 	mpo_mount_init_label_t			mpo_mount_init_label;
-	mpo_mount_fs_init_label_t		mpo_mount_fs_init_label;
 	mpo_mount_destroy_label_t		mpo_mount_destroy_label;
-	mpo_mount_fs_destroy_label_t		mpo_mount_fs_destroy_label;
 	mpo_mount_check_stat_t			mpo_mount_check_stat;
 	mpo_mount_create_t			mpo_mount_create;
 
-	/*
-	 * XXXRW: Technically, structure name here is pipepair, not pipe.
-	 */
+	mpo_netinet_fragment_t			mpo_netinet_fragment;
+	mpo_netinet_icmp_reply_t		mpo_netinet_icmp_reply;
+	mpo_netinet_tcp_reply_t			mpo_netinet_tcp_reply;
+
 	mpo_pipe_init_label_t			mpo_pipe_init_label;
 	mpo_pipe_destroy_label_t		mpo_pipe_destroy_label;
 	mpo_pipe_copy_label_t			mpo_pipe_copy_label;
@@ -815,18 +799,18 @@
 	 * XXXRW: These names are a bit awkard.  Perhaps sysv_msq to match
 	 * conventional usage?
 	 */
-	mpo_sysv_msgqueue_init_label_t		mpo_sysv_msgqueue_init_label;
-	mpo_sysv_msgqueue_destroy_t		mpo_sysv_msgqueue_destroy;
-	mpo_sysv_msgqueue_cleanup_t		mpo_sysv_msgqueue_cleanup;
-	mpo_sysv_msgqueue_create_msg_t		mpo_sysv_msgqueue_create_msg;
-	mpo_sysv_msgqueue_create_t		mpo_sysv_msgqueue_create;
-	mpo_sysv_msgqueue_check_msgmsq_t	mpo_sysv_msgqueue_check_msgmsq;
-	mpo_sysv_msgqueue_check_msgrcv_t	mpo_sysv_msgqueue_check_msgrcv;
-	mpo_sysv_msgqueue_check_msgrmid_t	mpo_sysv_msgqueue_check_msgrmid;
-	mpo_sysv_msgqueue_check_msqget_t	mpo_sysv_msgqueue_check_msqget;
-	mpo_sysv_msgqueue_check_msqsnd_t	mpo_sysv_msgqueue_check_msqsnd;
-	mpo_sysv_msgqueue_check_msqrcv_t	mpo_sysv_msgqueue_check_msqrcv;
-	mpo_sysv_msgqueue_check_msqctl_t	mpo_sysv_msgqueue_check_msqctl;
+	mpo_sysv_msq_init_label_t		mpo_sysv_msq_init_label;
+	mpo_sysv_msq_destroy_t			mpo_sysv_msq_destroy;
+	mpo_sysv_msq_cleanup_t			mpo_sysv_msq_cleanup;
+	mpo_sysv_msq_create_msg_t		mpo_sysv_msq_create_msg;
+	mpo_sysv_msq_create_t			mpo_sysv_msq_create;
+	mpo_sysv_msq_check_msgmsq_t		mpo_sysv_msq_check_msgmsq;
+	mpo_sysv_msq_check_msgrcv_t		mpo_sysv_msq_check_msgrcv;
+	mpo_sysv_msq_check_msgrmid_t		mpo_sysv_msq_check_msgrmid;
+	mpo_sysv_msq_check_msqget_t		mpo_sysv_msq_check_msqget;
+	mpo_sysv_msq_check_msqsnd_t		mpo_sysv_msq_check_msqsnd;
+	mpo_sysv_msq_check_msqrcv_t		mpo_sysv_msq_check_msqrcv;
+	mpo_sysv_msq_check_msqctl_t		mpo_sysv_msq_check_msqctl;
 
 	mpo_sysv_msg_init_label_t		mpo_sysv_msg_init_label;
 	mpo_sysv_msg_destroy_label_t		mpo_sysv_msg_destroy_label;


More information about the trustedbsd-cvs mailing list