Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758202AbYAHKrg (ORCPT ); Tue, 8 Jan 2008 05:47:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754600AbYAHKpA (ORCPT ); Tue, 8 Jan 2008 05:45:00 -0500 Received: from ms0.nttdata.co.jp ([163.135.193.231]:42773 "EHLO ms0.nttdata.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754096AbYAHKor (ORCPT ); Tue, 8 Jan 2008 05:44:47 -0500 Message-Id: <20080108095003.195209402@nttdata.co.jp> References: <20080108094903.484613061@nttdata.co.jp> User-Agent: quilt/0.46-1 Date: Tue, 08 Jan 2008 18:49:17 +0900 From: Kentaro Takeda To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Kentaro Takeda , Tetsuo Handa Subject: [TOMOYO #6 14/21] Network access control functions. X-OriginalArrivalTime: 08 Jan 2008 09:50:03.0412 (UTC) FILETIME=[D76EF540:01C851DB] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="boundary-1" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 35251 Lines: 465 --boundary-1 Content-Disposition: inline; filename="tomoyo-net.patch" Content-Type: application/octect-stream Content-Transfer-Encoding: base64 VE9NT1lPIExpbnV4IGNoZWNrcyBwZXJtaXNzaW9uIGJ5IHRoZSBmb2xsb3dpbmcgZm91ciBwYXJh bWV0ZXJzLg0KICAqIHByb3RvY29sIHR5cGUgKFRDUCwgVURQLCBSQVcpDQogICogYWNjZXNzIHR5 cGUgKGJpbmQsIGxpc3RlbiwgY29ubmVjdCwgYWNjZXB0KQ0KICAqIElQIGFkZHJlc3MgKEJvdGgg SVB2NCBhbmQgSVB2NiBhcmUgYXZhaWxhYmxlKQ0KICAqIHBvcnQgbnVtYmVyDQpJbiBvcmRlciB0 byBjaGVjayAnVENQIGFjY2VwdCcgY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V0d29ya19yZWN2bXNnX2FjbChjb25zdCBib29s IGlzX2lwdjYsIGNvbnN0IGludCBzb2NrX3R5cGUsDQorCQkJICAgIGNvbnN0IHU4ICphZGRyZXNz LCBjb25zdCB1MTYgcG9ydCkNCit7DQorCXJldHVybiB0bXlfbmV0d29ya19lbnRyeShpc19pcHY2 LCBzb2NrX3R5cGUgPT0gU09DS19ER1JBTSA/DQorCQkJCSBUTVlfTkVUV09SS19BQ0xfVURQX0NP Tk5FQ1QgOg0KKwkJCQkgVE1ZX05FVFdPUktfQUNMX1JBV19DT05ORUNULA0KKwkJCQkgYWRkcmVz cywgbnRvaHMocG9ydCkpOw0KK30NCg0KLS0gDQo= --boundary-1-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/