3 char buf_buf
[BUF_SIZE
+ CLICK_SIZE
];
7 /* SEF functions and variables. */
8 static void sef_local_startup(void);
10 /*===========================================================================*
12 *===========================================================================*/
13 int main(int argc
, char **argv
)
15 endpoint_t ep_self
, ep_requestor
, ep_child
;
21 /* SEF local startup. */
22 env_setargs(argc
, argv
);
26 buf
= (char*) CLICK_CEIL(buf_buf
);
27 fid_send
= open(FIFO_GRANTOR
, O_WRONLY
);
28 fid_get
= open(FIFO_REQUESTOR
, O_RDONLY
);
29 if(fid_get
< 0 || fid_send
< 0) {
30 printf("GRANTOR: can't open fifo files.\n");
34 /* Get the requestor's endpoint. */
35 read(fid_get
, &ep_requestor
, sizeof(ep_requestor
));
36 dprint("GRANTOR: getting requestor's endpoint: %d\n", ep_requestor
);
39 gid
= cpf_grant_direct(ep_requestor
, (long)buf
, BUF_SIZE
,
40 CPF_READ
| CPF_WRITE
| CPF_MAP
);
41 ep_self
= getprocnr();
42 dprint("GRANTOR: sending my endpoint %d and gid %d\n", ep_self
, gid
);
43 write(fid_send
, &ep_self
, sizeof(ep_self
));
44 write(fid_send
, &gid
, sizeof(gid
));
48 FIFO_NOTIFY(fid_send
);
54 /*===========================================================================*
56 *===========================================================================*/
57 static void sef_local_startup()
59 /* Let SEF perform startup. */