Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

FIFO_ACL_Grant

FIFOs are an IPC mechanism in Brew MP that you access with file-like names. The FIFO part of FIFO_ACL_GRANT means that the ACLs govern the FIFO namespace. The IFIFO interface provides a light weight form of InterProcess Communication (IPC), which simply uses a kernel buffer, which is specified by "path". "FIFO_ACL_Grant" grants the access permissions to such a buffer for IFIFO communications.

See the FS_ACL_Grant topic for more information.

Prototype

FIFO_ACL_Grant { 
   {groups = {AEECLSID_Cls1,AEECLSID_Cls2}, perms = "r/w"}, 
   {groups = {AEECLSID_Cls3,AEECLSID_Cls4}, perms = "rw/rw"}, 
   path = "/" ,
}
  • groups: Groups within a specified path that have permissions specified by the perms parameter.
  • perms: Permissions granted to the specified groups. The syntax for perms is:

    perms = [r] [w] / [r] [w]

    Perms consists of two permission grants that are separated by a forward slash, /. The first permission grant is applied to the exact directory indicated by the path. The second permission grant is applied to all the subdirectories under the directory indicated by the path. The r grants read permission, the w grants write permission, and the rw grants both read and write permission. An empty grant means no permissions.

  • path: Specifies the path these grants govern. The path is relative to the module's directory. For example, for a module named "foo", "/" means "fs:/mod/foo/" and "/a" means "fs:/mod/foo/a".

Example

For example, where there are four files named AEECLSID_Cls1.bid, AEECLSID_Cls2.bid, AEECLSID_Cls3.bid, and AEECLSID_Cls4.bid that contain the following definitions of friendly ClassIDs:

#define AEECLSID_Cls1 0x6F30438A
#define AEECLSID_Cls2 0x4F83A058
#define AEECLSID_Cls3 0xA603B3D1
#define AEECLSID_Cls4 0xF50F4753

The CIF file that contains the FIFO_ACL_Grant primitive can include AEECLSID_Cls1.bid, AEECLSID_Cls2.bid, AEECLSID_Cls3.bid, and AEECLSID_Cls4.bid. You can use either friendly ClassIDs or raw ClassIDs.

 include "AEECLSID_Cls1.bid" -- Need to include to use AEECLSID_Cls1
include "AEECLSID_Cls2.bid"  -- Need to include to use AEECLSID_Cls2
include "AEECLSID_Cls3.bid"  -- Need to include to use AEECLSID_Cls3
include "AEECLSID_Cls4.bid"  -- Need to include to use AEECLSID_Cls4

FIFO_ACL_Grant{
   {groups = {AEECLSID_ Cls1, AEECLSID_Cls2},   perms = "r/" },  
   {groups =  {AEECLSID_ Cls3, AEECLSID_ Cls4}, perms = "rw/r"}, 
    path = "/endpoint", 
}

As a use case for FIFO_ACL_Grant, if two applications need to communicate, they can use fifo:/~/endpoint. Class Foo then "owns" this space. This ownership is enforced by the Brew MP IFIFO API implementation. Class Foo grants access to "/endpoint" using FIFO_ACL_Grant, which allows applets other than Foo to access it.