1mms_send_cmd(3MMS) Media Management System Library Functionsmms_send_cmd(3MMS)
2
3
4

NAME

6       mms_send_cmd, mms_send_acmd, mms_read_response, mms_free_rsp - communi‐
7       cation functions for MMS client
8

SYNOPSIS

10       cc [ flag...] file... -lmms [ library...]
11       #include <mms_api.h>
12
13       int mms_send_cmd(void *session, char *cmd, void **rsp);
14
15
16       int mms_send_acmd(void *session, char *cmd,
17            void (*callbk)(void *arg, void *arg1), void callbk_parm);
18
19
20       int mms_read_response(void *session, char *tid, void **rsp);
21
22
23       void mms_free_rsp(void *rsp);
24
25

DESCRIPTION

27       For these functions, session specifies which session to use to communi‐
28       cate with the MMS.
29
30
31       The  mms_send_cmd() function sends an MMP command cmd with a task ID of
32       tid to MMS. On successful completion of the command,  the  response  is
33       returned  in  rsp. This function can be used in either a synchronous or
34       asynchronous session.
35
36
37       The mms_send_acmd() function sends an MMP command cmd with a task ID of
38       tid  to MMS, but does not wait for a response from MMS. When a response
39       is received, the API invokes the call  back  function  callbk,  passing
40       callbk_parm  as the first argument and the response as the second argu‐
41       ment. This function can only be used in an asynchronous session.
42
43
44       The mms_read_response() function obtains additional  responses  if  the
45       response  to  mms_send_cmd()  or  mms_send_acmd()  function returned an
46       "intermediate" response. This occurs  when  the  response  exceeds  the
47       allowed size and has to be delivered in several separate responses.
48
49
50       The mms_free_rsp() function frees the memory associated with a response
51       from one of the communication functions.
52
53   Response Types
54       There are five possible responses from MMS:
55
56       cancelled       The client cancelled the command prior to MMS  starting
57                       execution of it.
58
59
60       error           The  command  failed  to be executed. The format of the
61                       error response contains a error class and code indicat‐
62                       ing  the  type  of  failure  that occurred. An optional
63                       error message may also be specified.
64
65
66       intermediate    The response contains data that exceeds a preset memory
67                       size  that  a response can contain. If a command gener‐
68                       ates a response that exceeds the  preset  memory  size,
69                       MMS breaks the response into a series of responses con‐
70                       sisting of one or more intermediate responses  followed
71                       by   a  success  response.  Each  of  the  intermediate
72                       responses and the success response will contain a valid
73                       response structure that the client can process individ‐
74                       ually.
75
76
77       success         The command has completed successfully. The  data  that
78                       is  returned  with the success response is dependent on
79                       what the command requested for a report.
80
81
82       unacceptable    The syntax of the command the client sent  to  MMS  was
83                       invalid.
84
85

RETURN VALUES

87       Upon  successful  completion,  MMS_API_OK  is  returned.  If a function
88       encounters a processing error, it returns an error code indicating  the
89       type of error.
90

ERRORS

92       These functions will fail if:
93
94       MMS_API_ERR               Unrecoverable   internal   processing   error
95                                 occurred.
96
97
98       MMS_API_NOT_ERR_RSP       Response is not an error response.
99
100
101       MMS_API_SHUTDOWN          Client has shut down API.
102
103
104       MMS_ASYNC_API_FAILURE     Reader thread unable to obtain reader mutex.
105
106
107       MMS_CFG_FILE_ERR          Unable to open watcher daemon's network  con‐
108                                 figuration file.
109
110
111       MMS_E_CONNECT_ERR         Failed to connect to MMS.
112
113
114       MMS_E_INVALID_RESPONSE    Invalid MMS response to command.
115
116
117       MMS_E_NET_IO_ERR          Connection failure to MMS.
118
119
120       MMS_E_SYNTAX_ERR          MMS response contained a syntax error.
121
122
123       MMS_ERR_BIAS              Unknown Error code.
124
125
126       MMS_INVALID_RSP           Unknown response type received.
127
128
129       MMS_MALLOC_ERROR          Unable to allocate required space.
130
131
132       MMS_MISSING_TASKID        Unable to find task ID in response.
133
134
135       MMS_SELECT_ERROR          Select system call failed.
136
137
138       MMS_TRACE_FAILURE         Unable to open API's trace file.
139
140
141       MMS_WRONG_API_MODE        API  session  does  not support this API com‐
142                                 mand.
143
144
145       MMS_WRONG_TASKID          Wrong task ID found for accept response.
146
147

ATTRIBUTES

149       See attributes(5) for descriptions of the following attributes:
150
151
152
153
154       ┌─────────────────────────────┬─────────────────────────────┐
155       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
156       ├─────────────────────────────┼─────────────────────────────┤
157       │Interface Stability          │Uncommitted                  │
158       ├─────────────────────────────┼─────────────────────────────┤
159       │MT-Level                     │MT-Safe                      │
160       └─────────────────────────────┴─────────────────────────────┘
161

SEE ALSO

163       libmms(3LIB), mms_rsp_type(3MMS), mms_init(3MMS), attributes(5)
164
165
166
167SunOS 5.11                        28 Oct 2008               mms_send_cmd(3MMS)
Impressum