Changeset 10
- Timestamp:
- 07/27/07 08:46:56
(1 year ago)
- Author:
- tmiller
- Message:
Man page cleanup:
o remove definition of unused macros
o fix spacing
o use proper lists when describing parameters
o cross-ref correct destroy function
o sipc_send_data now takes a length parameter
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_CONNECT" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | int\ \fBsipc_connect\fR\ (sipc_t\ \fI*sipc\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | 15 | \fBsipc_connect\fR connects an IPC handle to an initialized IPC resource. |
|---|
| 39 | 16 | A call to \fBsipc_init\fR must be made before calling \fBsipc_connect\fR. |
|---|
| 40 | | |
|---|
| 41 | 17 | .SH "RETURN VALUE" |
|---|
| 42 | | |
|---|
| 43 | | .PP |
|---|
| 44 | | This function returns 0 on success, -1 on error. |
|---|
| 45 | | |
|---|
| | 18 | This function returns 0 on success, \-1 on error. |
|---|
| 46 | 19 | .SH "EXAMPLES" |
|---|
| 47 | | |
|---|
| 48 | | .PP |
|---|
| 49 | | |
|---|
| 50 | 20 | .nf |
|---|
| 51 | 21 | /* Sample code */ |
|---|
| | 22 | |
|---|
| 52 | 23 | ipc = sipc_init("ipc_key", size, ipc_type); |
|---|
| 53 | 24 | if (sipc_connect(ipc) < 0) |
|---|
| 54 | 25 | sipc_error(ipc, "Unable to connec to IPC resource."); |
|---|
| 55 | 26 | .fi |
|---|
| 56 | | |
|---|
| 57 | 27 | .SH "SEE ALSO" |
|---|
| 58 | | |
|---|
| 59 | | .PP |
|---|
| 60 | | \fBsipc_init(3)\fR, \fBsipc_disconnect(3)\fR, \fBsipc_error(3)\fR. |
|---|
| 61 | | |
|---|
| | 28 | \fBsipc_init(3)\fR, \fBsipc_disconnect(3)\fR, \fBsipc_error(3)\fR |
|---|
| 62 | 29 | .SH AUTHOR |
|---|
| 63 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 30 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_CREATE" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | int\ \fBsipc_create\fR\ (char\ \fI*key\fR, int\ \fIipc_type\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | 15 | \fBsipc_create\fR creates an IPC resource. The type of IPC resource created |
|---|
| 39 | 16 | depends upon the ipc_type flag. It should only be called by helper applications |
|---|
| 40 | | not actually participating in the communications process. The function |
|---|
| 41 | | parameters are as follows: |
|---|
| 42 | | |
|---|
| 43 | | .nf |
|---|
| 44 | | key - A path which will serve as a key identifying the IPC resource to |
|---|
| | 17 | not actually participating in the communications process. |
|---|
| | 18 | .PP |
|---|
| | 19 | The function parameters are as follows: |
|---|
| | 20 | .TP |
|---|
| | 21 | .I key |
|---|
| | 22 | A path which will serve as a key identifying the IPC resource to |
|---|
| 45 | 23 | communicating processes. |
|---|
| 46 | | ipc_type - One of SIPC_SYSV_MQUEUES or SIPC_SYSV_SHM for message queues or |
|---|
| | 24 | .TP |
|---|
| | 25 | .I ipc_type |
|---|
| | 26 | One of SIPC_SYSV_MQUEUES or SIPC_SYSV_SHM for message queues or |
|---|
| 47 | 27 | shared memory, respectively. |
|---|
| 48 | | .if |
|---|
| 49 | | |
|---|
| 50 | 28 | .PP |
|---|
| 51 | 29 | Once an IPC resource has been created, it can be destroyed by either the |
|---|
| 52 | 30 | sending or receiving process. |
|---|
| 53 | | |
|---|
| 54 | 31 | .SH "RETURN VALUE" |
|---|
| 55 | | .PP |
|---|
| 56 | 32 | This function returns 0 on success, -1 on error. |
|---|
| 57 | | |
|---|
| 58 | 33 | .SH "EXAMPLES" |
|---|
| 59 | | .PP |
|---|
| 60 | | |
|---|
| 61 | 34 | .nf |
|---|
| 62 | 35 | /* Sample code */ |
|---|
| 63 | | #define SIPC_KEY "/tmp/sipc_key" /* Sender & receiver must know the key */ |
|---|
| | 36 | |
|---|
| | 37 | /* Sender & receiver must know the key */ |
|---|
| | 38 | #define SIPC_KEY "/tmp/sipc_key" |
|---|
| 64 | 39 | |
|---|
| 65 | 40 | /* Create an IPC resource, specifically a SYSV message queue here */ |
|---|
| … | … | |
| 67 | 42 | fprintf(stderr, "Unable to create IPC resource."); |
|---|
| 68 | 43 | .fi |
|---|
| 69 | | |
|---|
| 70 | 44 | .SH "SEE ALSO" |
|---|
| 71 | | |
|---|
| 72 | | .PP |
|---|
| 73 | | \fBsipc_destroy(3)\fR, \fBsipc_init(3)\fR, \fBsipc_connect(3)\fR. |
|---|
| 74 | | |
|---|
| | 45 | \fBsipc_destroy_resource(3)\fR, \fBsipc_init(3)\fR, \fBsipc_connect(3)\fR |
|---|
| 75 | 46 | .SH AUTHOR |
|---|
| 76 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 47 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_DESTROY_HANDLE" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| 23 | | sipc_destroy_handle\- Free resources associated with a secure IPC handle |
|---|
| | 5 | sipc_destroy_handle \- Free resources associated with a secure IPC handle |
|---|
| 24 | 6 | .SH "SYNOPSIS" |
|---|
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | void\ \fBsipc_destroy_handle\fR\ (sipc_t\ \fI*sipc\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | 15 | \fBsipc_destroy_handle\fR frees memory associated with a secure IPC handle |
|---|
| 39 | 16 | that was obtained via \fBsipc_init\fR. |
|---|
| 40 | | |
|---|
| 41 | 17 | .SH "RETURN VALUE" |
|---|
| 42 | | .PP |
|---|
| 43 | | This function does not have a return value. |
|---|
| 44 | | |
|---|
| | 18 | This function has no return value. |
|---|
| 45 | 19 | .SH "SEE ALSO" |
|---|
| 46 | | |
|---|
| 47 | | .PP |
|---|
| 48 | | \fBsipc_init(3)\fR, \fBsipc_create\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR. |
|---|
| 49 | | |
|---|
| | 20 | \fBsipc_init(3)\fR, \fBsipc_create\fR, \fBsipc_connect(3)\fR, |
|---|
| | 21 | \fBsipc_disconnect(3)\fR |
|---|
| 50 | 22 | .SH AUTHOR |
|---|
| 51 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 23 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_DESTROY_HANDLE" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| 23 | | sipc_destroy_resource\- Free IPC resources associated with a secure IPC handle |
|---|
| | 5 | sipc_destroy_resource \- Free IPC resources associated with a secure IPC handle |
|---|
| 24 | 6 | .SH "SYNOPSIS" |
|---|
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | void\ \fBsipc_destroy_resource\fR\ (char\ \fI*key\fR, int\ \fIipc_type\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | 15 | \fBsipc_destroy_resource\fR frees IPC resources obtained via \fBsipc_create\fR. |
|---|
| 39 | 16 | This function is the inverse of \fBsipc_create\fR and should only be called by |
|---|
| … | … | |
| 41 | 18 | All processes using the IPC resource should call \fBsipc_disconnect\fR before |
|---|
| 42 | 19 | the destroyer process calls \fBsipc_destroy_resource\fR. |
|---|
| | 20 | .PP |
|---|
| 43 | 21 | The function parameters are as follows: |
|---|
| 44 | | |
|---|
| 45 | | .nf |
|---|
| 46 | | key - A string which will serve as the identifier for the IPC resource. |
|---|
| 47 | | ipc_type - One of SIPC_SYSV_MQUEUES or SIPC_SYSV_SHM for message queues |
|---|
| | 22 | .TP |
|---|
| | 23 | .I key |
|---|
| | 24 | A string which will serve as the identifier for the IPC resource. |
|---|
| | 25 | .TP |
|---|
| | 26 | .I ipc_type |
|---|
| | 27 | One of SIPC_SYSV_MQUEUES or SIPC_SYSV_SHM for message queues |
|---|
| 48 | 28 | or shared memory, respectively. |
|---|
| 49 | | .if |
|---|
| 50 | | |
|---|
| 51 | 29 | .SH "RETURN VALUE" |
|---|
| 52 | | .PP |
|---|
| 53 | | This function does not have a return value. |
|---|
| 54 | | |
|---|
| | 30 | This function has no return value. |
|---|
| 55 | 31 | .SH "SEE ALSO" |
|---|
| 56 | | |
|---|
| 57 | | .PP |
|---|
| 58 | | \fBsipc_init(3)\fR, \fBsipc_create\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR. |
|---|
| 59 | | |
|---|
| | 32 | \fBsipc_init(3)\fR, \fBsipc_create\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR |
|---|
| 60 | 33 | .SH AUTHOR |
|---|
| 61 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 34 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_DISCONNECT" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | void\ \fBsipc_disconnect\fR\ (sipc_t\ \fI*sipc\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | 15 | \fBsipc_disconnect\fR disconnects an IPC handle. The resources held by the |
|---|
| 39 | 16 | IPC handle are not freed; a call to \fBsipc_destroy\fR must be made to free |
|---|
| 40 | 17 | these resources. |
|---|
| 41 | | |
|---|
| 42 | 18 | .SH "RETURN VALUE" |
|---|
| 43 | | |
|---|
| 44 | | .PP |
|---|
| 45 | | No return value. |
|---|
| 46 | | |
|---|
| | 19 | This function has no return value. |
|---|
| 47 | 20 | .SH "SEE ALSO" |
|---|
| 48 | | |
|---|
| 49 | | .PP |
|---|
| 50 | | \fBsipc_connect(3)\fR, \fBsipc_init(3)\fR, \fBsipc_destroy(3)\fR |
|---|
| 51 | | |
|---|
| | 21 | \fBsipc_connect(3)\fR, \fBsipc_init(3)\fR, \fBsipc_destroy_handle(3)\fR |
|---|
| 52 | 22 | .SH AUTHOR |
|---|
| 53 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 23 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_ERROR" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | int\ \fBsipc_error\fR\ (sipc_t\ \fI*sipc\fR, char\ \fI*format\fR, ...); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | 15 | \fBsipc_error\fR is used for reporting errors that occur during secure IPC. |
|---|
| 39 | 16 | This function recognizes \fBprintf(3)\fR style format strings. |
|---|
| 40 | | |
|---|
| 41 | 17 | .SH "RETURN VALUE" |
|---|
| 42 | | .PP |
|---|
| 43 | | This function returns 0 on success, -1 on error. |
|---|
| 44 | | |
|---|
| | 18 | This function returns 0 on success, \-1 on error. |
|---|
| 45 | 19 | .SH "SEE ALSO" |
|---|
| 46 | | |
|---|
| 47 | | .PP |
|---|
| 48 | 20 | \fBsipc_send_data(3)\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR. |
|---|
| 49 | | |
|---|
| 50 | 21 | .SH AUTHOR |
|---|
| 51 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 22 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_GET_DATA_PTR" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | char\ *\fBsipc_connect\fR\ (sipc_t\ \fI*sipc\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | 15 | \fBsipc_connect\fR connects an IPC handle to an initialized IPC resource. |
|---|
| 39 | 16 | A call to \fBsipc_init\fR must be made before calling \fBsipc_connect\fR. |
|---|
| 40 | | |
|---|
| 41 | 17 | .SH "RETURN VALUE" |
|---|
| 42 | | |
|---|
| 43 | | .PP |
|---|
| 44 | 18 | This function returns a pointer to the handle's data member on success, |
|---|
| 45 | 19 | NULL on error. |
|---|
| 46 | | |
|---|
| 47 | 20 | .SH "EXAMPLES" |
|---|
| 48 | | .PP |
|---|
| 49 | | |
|---|
| 50 | 21 | .nf |
|---|
| 51 | 22 | /* Sample code */ |
|---|
| | 23 | |
|---|
| 52 | 24 | char msg[] = "Hello, world."; |
|---|
| 53 | | data = sipc_get_data_ptr(ipc); /* Get a pointer to the handle's data */ |
|---|
| 54 | | strncpy(data, msg, size); /* Copy message into the handle */ |
|---|
| 55 | | if (sipc_send_data(ipc) < 0) /* Send the message */ |
|---|
| | 25 | data = sipc_get_data_ptr(ipc); /* Get data pointer from handle */ |
|---|
| | 26 | strncpy(data, msg, size); /* Copy message into the handle */ |
|---|
| | 27 | if (sipc_send_data(ipc, size) < 0) /* Send the message */ |
|---|
| 56 | 28 | sipc_error(ipc, "Unable to send data."); |
|---|
| 57 | | |
|---|
| 58 | 29 | .fi |
|---|
| 59 | | |
|---|
| 60 | 30 | .SH "SEE ALSO" |
|---|
| 61 | | |
|---|
| 62 | | .PP |
|---|
| 63 | | \fBsipc_init(3)\fR, \fBsipc_disconnect(3)\fR, \fBsipc_send_data(3)\fR, \fBsipc_recv_data(3)\fR, \fBsipc_error(3)\fR. |
|---|
| 64 | | |
|---|
| | 31 | \fBsipc_init(3)\fR, \fBsipc_disconnect(3)\fR, \fBsipc_send_data(3)\fR, \fBsipc_recv_data(3)\fR, \fBsipc_error(3)\fR |
|---|
| 65 | 32 | .SH AUTHOR |
|---|
| 66 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 33 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_CONNECT" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | | int\ \fBsipc_init\fR\ (char\ \fI*key\fR, int\ \fIipc_type\fR, size_t\ \fIsize\fR, int\ \fIsender\fR); |
|---|
| | 11 | sipc_t\ *\ \fBsipc_init\fR\ (char\ \fI*key\fR, int\ \fIipc_type\fR, size_t\ \fIsize\fR, int\ \fIsender\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| | 15 | \fBsipc_init\fR allocates and initializes an IPC handle, allowing it to be |
|---|
| | 16 | used in secure communications. |
|---|
| | 17 | A call to \fBsipc_init\fR must be made before calling \fBsipc_connect\fR. |
|---|
| 37 | 18 | .PP |
|---|
| 38 | | \fBsipc_init\fR initializes an IPC handle, allowing it to be used in secure |
|---|
| 39 | | communications. A call to \fBsipc_init\fR must be made before calling |
|---|
| 40 | | \fBsipc_connect\fR. The function parameters are as follows: |
|---|
| 41 | | |
|---|
| 42 | | .nf |
|---|
| 43 | | key - A string which serves as an identifier for this IPC resource |
|---|
| 44 | | ipc_type - The type of IPC to be used for communications; ex: SIPC_SYSV_MQUEUES |
|---|
| 45 | | size - Size, in bytes, of the IPC handle's data member. The data member is allocated |
|---|
| 46 | | in \fBsipc_init\fR |
|---|
| 47 | | sender - Flag indicating whether this IPC handle will be used for sending |
|---|
| 48 | | or receiving data. Sending processes should pass 1 here, receiving processes should pass 0. |
|---|
| 49 | | .if |
|---|
| 50 | | |
|---|
| | 19 | The function parameters are as follows: |
|---|
| | 20 | .TP |
|---|
| | 21 | .I key |
|---|
| | 22 | A string which serves as an identifier for this IPC resource. |
|---|
| | 23 | .TP |
|---|
| | 24 | .I ipc_type |
|---|
| | 25 | The type of IPC to be used for communications, e.g. SIPC_SYSV_MQUEUES. |
|---|
| | 26 | .TP |
|---|
| | 27 | .I size |
|---|
| | 28 | Size, in bytes, of the IPC handle's data member. The data member is allocated |
|---|
| | 29 | in \fBsipc_init\fR. |
|---|
| | 30 | .TP |
|---|
| | 31 | .I sender |
|---|
| | 32 | Flag indicating whether this IPC handle will be used for sending |
|---|
| | 33 | or receiving data. Sending processes should pass 1 here, receiving |
|---|
| | 34 | processes should pass 0. |
|---|
| 51 | 35 | .SH "RETURN VALUE" |
|---|
| 52 | | .PP |
|---|
| 53 | | This function returns 0 on success, -1 on error. |
|---|
| 54 | | |
|---|
| | 36 | This function returns a pointer to the new IPC handle on success, NULL on error. |
|---|
| 55 | 37 | .SH "SEE ALSO" |
|---|
| 56 | | |
|---|
| 57 | | .PP |
|---|
| 58 | | \fBsipc_destroy(3)\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR. |
|---|
| 59 | | |
|---|
| | 38 | \fBsipc_destroy_handle(3)\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR |
|---|
| 60 | 39 | .SH AUTHOR |
|---|
| 61 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 40 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_RECV_DATA" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | int\ \fBsipc_recv_data\fR\ (sipc_t\ \fI*sipc\fR, char\ \fI**data\fR, int\ \fI*len\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| | 15 | \fBsipc_recv_data\fR receives data from a secure IPC channel. |
|---|
| 37 | 16 | .PP |
|---|
| 38 | | \fBsipc_recv_data\fR receives data from a secure IPC channel. The function |
|---|
| 39 | | parameters are as follows: |
|---|
| 40 | | |
|---|
| 41 | | .nf |
|---|
| 42 | | sipc - An IPC handle |
|---|
| 43 | | data - Pointer to a buffer which will hold the data received from the channel |
|---|
| 44 | | len - This will hold the total number of bytes received |
|---|
| 45 | | .if |
|---|
| 46 | | |
|---|
| | 17 | The function parameters are as follows: |
|---|
| | 18 | .TP |
|---|
| | 19 | .I sipc |
|---|
| | 20 | An IPC handle |
|---|
| | 21 | .TP |
|---|
| | 22 | .I data |
|---|
| | 23 | Pointer to a buffer which will hold the data received from the channel |
|---|
| | 24 | .TP |
|---|
| | 25 | .I len |
|---|
| | 26 | This will hold the total number of bytes received |
|---|
| 47 | 27 | .PP |
|---|
| 48 | 28 | \fBsipc_recv_data\fR allocates the buffer used to store received data. It is |
|---|
| 49 | 29 | the responsibility of the caller to free this data. |
|---|
| 50 | | |
|---|
| 51 | 30 | .SH "RETURN VALUE" |
|---|
| 52 | | .PP |
|---|
| 53 | | This function returns 0 on success, -1 on error. |
|---|
| 54 | | |
|---|
| | 31 | This function returns 0 on success, \-1 on error. |
|---|
| 55 | 32 | .SH "EXAMPLES" |
|---|
| 56 | | .PP |
|---|
| 57 | | |
|---|
| 58 | 33 | .nf |
|---|
| 59 | 34 | /* Sample code */ |
|---|
| | 35 | |
|---|
| 60 | 36 | char *data = sipc_get_data_ptr(ipc); |
|---|
| 61 | 37 | sipc_recv_data(ipc, &data, &len); |
|---|
| … | … | |
| 65 | 41 | using shared memory */ |
|---|
| 66 | 42 | .fi |
|---|
| 67 | | |
|---|
| 68 | 43 | .SH "SEE ALSO" |
|---|
| 69 | | |
|---|
| 70 | | .PP |
|---|
| 71 | | \fBsipc_send_data(3)\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR, \fBsipc_error(3)\fR. |
|---|
| 72 | | |
|---|
| | 44 | \fBsipc_send_data(3)\fR, \fBsipc_connect(3)\fR, \fBsipc_disconnect(3)\fR, |
|---|
| | 45 | \fBsipc_error(3)\fR |
|---|
| 73 | 46 | .SH AUTHOR |
|---|
| 74 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 47 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_SEND_DATA" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | | int\ \fBsipc_send_data\fR\ (sipc_t\ \fI*sipc\fR); |
|---|
| | 11 | int\ \fBsipc_send_data\fR\ (sipc_t\ \fI*sipc\fR, int\ \fImsg_len\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | | \fBsipc_send_data\fR sends the data contained in an IPC handle across a secure |
|---|
| 39 | | channel. Depending on the amount of data contained in the handle and the |
|---|
| 40 | | underlying IPC mechanism used, fragmentation of the data may occur during |
|---|
| 41 | | transmission. Reassembly of fragmented data occurs transparently at the |
|---|
| 42 | | receiver's end, with a call to \fBsipc_recv_data\fR. In the case of shared |
|---|
| 43 | | memory, the caller must ensure that the size of the data contained in the |
|---|
| 44 | | handle does not exceed the system limit for shared memory segment size, in |
|---|
| 45 | | which case the data will be truncated prior to transmission. |
|---|
| 46 | | |
|---|
| | 15 | \fBsipc_send_data\fR sends \fImsg_len\fR bytes of data contained in an IPC |
|---|
| | 16 | handle across a secure channel. Depending on the size of \fImsg_len\fR and |
|---|
| | 17 | the underlying IPC mechanism used, fragmentation of the data may occur |
|---|
| | 18 | during transmission. Reassembly of fragmented data occurs transparently |
|---|
| | 19 | at the receiver's end, with a call to \fBsipc_recv_data\fR. In the case of |
|---|
| | 20 | shared memory, the caller must ensure that the size of the data contained |
|---|
| | 21 | in the handle does not exceed the system shared memory segment size limit, |
|---|
| | 22 | in which case the data will be truncated prior to transmission. |
|---|
| 47 | 23 | .SH "RETURN VALUE" |
|---|
| 48 | | .PP |
|---|
| 49 | | This function returns 0 on success, -1 on error. |
|---|
| 50 | | |
|---|
| | 24 | This function returns 0 on success, \-1 on error. |
|---|
| 51 | 25 | .SH "EXAMPLES" |
|---|
| 52 | | .PP |
|---|
| 53 | | |
|---|
| 54 | 26 | .nf |
|---|
| 55 | 27 | /* Sample code */ |
|---|
| | 28 | |
|---|
| 56 | 29 | char msg[] = "Hello, world."; |
|---|
| 57 | | data = sipc_get_data_ptr(ipc); /* Get a pointer to the handle's data */ |
|---|
| 58 | | strncpy(data, msg, size); /* Copy mesasge into the handle */ |
|---|
| 59 | | if (sipc_send_data(ipc) < 0) /* Send the message */ |
|---|
| | 30 | data = sipc_get_data_ptr(ipc); /* Get data pointer from handle */ |
|---|
| | 31 | strncpy(data, msg, size); /* Copy mesasge into the handle */ |
|---|
| | 32 | if (sipc_send_data(ipc, size) < 0) /* Send the message */ |
|---|
| 60 | 33 | sipc_error(ipc, "Unable to send data."); |
|---|
| 61 | 34 | .fi |
|---|
| 62 | | |
|---|
| 63 | 35 | .SH "SEE ALSO" |
|---|
| 64 | | |
|---|
| 65 | | .PP |
|---|
| 66 | 36 | \fBsipc_recv_data(3)\fR, \fBsipc_get_data_ptr(3)\fR, \fBsipc_connect(3)\fR, |
|---|
| 67 | | \fBsipc_disconnect(3)\fR, \fBsipc_error(3)\fR. |
|---|
| 68 | | |
|---|
| | 37 | \fBsipc_disconnect(3)\fR, \fBsipc_error(3)\fR |
|---|
| 69 | 38 | .SH AUTHOR |
|---|
| 70 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 39 | David Windsor <dwindsor@tresys.com> |
|---|
| r4 |
r10 |
|
| 1 | 1 | .\" Copyright (C) 2006, 2007 Tresys Technology, LLC |
|---|
| 2 | 2 | .\" This file is distributed according to the GNU Lesser General Public License |
|---|
| 3 | | .de Sh \" Subsection |
|---|
| 4 | | .br |
|---|
| 5 | | .if t .Sp |
|---|
| 6 | | .ne 5 |
|---|
| 7 | | .PP |
|---|
| 8 | | \fB\\$1\fR |
|---|
| 9 | | .PP |
|---|
| 10 | | .. |
|---|
| 11 | | .de Sp \" Vertical space (when we can't use .PP) |
|---|
| 12 | | .if t .sp .5v |
|---|
| 13 | | .if n .sp |
|---|
| 14 | | .. |
|---|
| 15 | | .de Ip \" List item |
|---|
| 16 | | .br |
|---|
| 17 | | .ie \\n(.$>=3 .ne \\$3 |
|---|
| 18 | | .el .ne 3 |
|---|
| 19 | | .IP "\\$1" \\$2 |
|---|
| 20 | | .. |
|---|
| 21 | 3 | .TH "SIPC_SHM_RECV_DONE" 3 "2006-08-10" "Linux 2.6" "Linux Programmer's Manual" |
|---|
| 22 | 4 | .SH NAME |
|---|
| … | … | |
| 25 | 7 | .ad l |
|---|
| 26 | 8 | .hy 0 |
|---|
| 27 | | |
|---|
| 28 | 9 | #include <sipc/sipc.h> |
|---|
| 29 | | .sp |
|---|
| 30 | 10 | .HP 20 |
|---|
| 31 | 11 | int\ \fBsipc_shm_recv_done\fR\ (sipc_t\ \fI*sipc\fR); |
|---|
| 32 | 12 | .ad |
|---|
| 33 | 13 | .hy |
|---|
| 34 | | |
|---|
| 35 | 14 | .SH "DESCRIPTION" |
|---|
| 36 | | |
|---|
| 37 | | .PP |
|---|
| 38 | 15 | \fBsipc_shm_recv_done\fR is called by an application receiving messages using |
|---|
| 39 | 16 | shared memory during secure IPC. \fBsipc_shm_recv_done\fR unblocks the sending |
|---|
| 40 | 17 | process, allowing it to send more data. This function only needs to be called |
|---|
| 41 | 18 | when using shared memory as a backend for secure IPC. |
|---|
| 42 | | |
|---|
| 43 | 19 | .SH "RETURN VALUE" |
|---|
| 44 | | |
|---|
| 45 | | .PP |
|---|
| 46 | | This function returns 0 on success, -1 on error. |
|---|
| 47 | | |
|---|
| | 20 | This function returns 0 on success, \-1 on error. |
|---|
| 48 | 21 | .SH "EXAMPLES" |
|---|
| 49 | | .PP |
|---|
| 50 | | |
|---|
| 51 | 22 | .nf |
|---|
| 52 | 23 | /* Sample code */ |
|---|
| | 24 | |
|---|
| 53 | 25 | char *data = sipc_get_data_ptr(ipc); |
|---|
| 54 | 26 | sipc_recv_data(ipc, &data, &len); |
|---|
| … | … | |
| 58 | 30 | using shared memory */ |
|---|
| 59 | 31 | .fi |
|---|
| 60 | | |
|---|
| 61 | 32 | .SH "SEE ALSO" |
|---|
| 62 | | |
|---|
| 63 | | .PP |
|---|
| 64 | | \fBsipc_send_data(3)\fR, \fBsipc_recv_data(3)\fR, \fBsipc_error(3)\fR. |
|---|
| 65 | | |
|---|
| | 33 | \fBsipc_send_data(3)\fR, \fBsipc_recv_data(3)\fR, \fBsipc_error(3)\fR |
|---|
| 66 | 34 | .SH AUTHOR |
|---|
| 67 | | David Windsor <dwindsor@tresys.com>. |
|---|
| | 35 | David Windsor <dwindsor@tresys.com> |
|---|
Download in other formats:
* Generating other formats may take time.