Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dhcp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
72
Issues
72
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
dhcp
Commits
47e746b7
Commit
47e746b7
authored
Sep 09, 1999
by
Ted Lemon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add delete method and notify_object.
parent
3c48d369
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
6 deletions
+55
-6
includes/omapip/omapip.h
includes/omapip/omapip.h
+6
-1
omapip/message.c
omapip/message.c
+49
-5
No files found.
includes/omapip/omapip.h
View file @
47e746b7
...
...
@@ -135,6 +135,7 @@ typedef struct __omapi_object_type_t {
isc_result_t
(
*
lookup
)
(
omapi_object_t
**
,
omapi_object_t
*
,
omapi_object_t
*
);
isc_result_t
(
*
create
)
(
omapi_object_t
**
,
omapi_object_t
*
);
isc_result_t
(
*
delete
)
(
omapi_object_t
*
,
omapi_object_t
*
);
}
omapi_object_type_t
;
#define OMAPI_OBJECT_PREAMBLE \
...
...
@@ -156,6 +157,7 @@ struct __omapi_object {
#define OMAPI_OP_UPDATE 3
#define OMAPI_OP_NOTIFY 4
#define OMAPI_OP_STATUS 5
#define OMAPI_OP_DELETE 6
#include <omapip/buffer.h>
...
...
@@ -181,6 +183,7 @@ typedef struct __omapi_message_object {
OMAPI_OBJECT_PREAMBLE
;
struct
__omapi_message_object
*
next
,
*
prev
;
omapi_object_t
*
object
;
omapi_object_t
*
notify_object
;
int
authlen
;
omapi_typed_data_t
*
authenticator
;
int
authid
;
...
...
@@ -437,6 +440,8 @@ isc_result_t omapi_object_type_register (omapi_object_type_t **,
omapi_object_t
*
,
omapi_object_t
*
),
isc_result_t
(
*
)
(
omapi_object_t
**
,
omapi_object_t
*
),
isc_result_t
(
*
)
(
omapi_object_t
*
,
omapi_object_t
*
));
isc_result_t
omapi_signal
(
omapi_object_t
*
,
char
*
,
...);
isc_result_t
omapi_signal_in
(
omapi_object_t
*
,
char
*
,
...);
...
...
@@ -464,7 +469,7 @@ isc_result_t omapi_stuff_values (omapi_object_t *,
isc_result_t
omapi_object_create
(
omapi_object_t
**
,
omapi_object_t
*
,
omapi_object_type_t
*
);
isc_result_t
omapi_object_update
(
omapi_object_t
*
,
omapi_object_t
*
,
omapi_object_t
*
);
omapi_object_t
*
,
omapi_handle_t
);
int
omapi_data_string_cmp
(
omapi_data_string_t
*
,
omapi_data_string_t
*
);
int
omapi_ds_strcmp
(
omapi_data_string_t
*
,
char
*
);
int
omapi_td_strcmp
(
omapi_typed_data_t
*
,
char
*
);
...
...
omapip/message.c
View file @
47e746b7
...
...
@@ -104,6 +104,18 @@ isc_result_t omapi_message_set_value (omapi_object_t *h,
"omapi_message_set_value"
);
return
ISC_R_SUCCESS
;
}
else
if
(
!
omapi_ds_strcmp
(
name
,
"notify-object"
))
{
if
(
value
->
type
!=
omapi_datatype_object
)
return
ISC_R_INVALIDARG
;
if
(
m
->
notify_object
)
omapi_object_dereference
(
&
m
->
notify_object
,
"omapi_message_set_value"
);
omapi_object_reference
(
&
m
->
notify_object
,
value
->
u
.
object
,
"omapi_message_set_value"
);
return
ISC_R_SUCCESS
;
/* Can set authid, but it has to be an integer. */
}
else
if
(
!
omapi_ds_strcmp
(
name
,
"authid"
))
{
if
(
value
->
type
!=
omapi_datatype_int
)
...
...
@@ -229,9 +241,14 @@ isc_result_t omapi_message_signal_handler (omapi_object_t *h,
return
ISC_R_INVALIDARG
;
m
=
(
omapi_message_object_t
*
)
h
;
if
(
!
strcmp
(
name
,
"status"
)
&&
m
->
object
)
{
return
((
m
->
object
->
type
->
signal_handler
))
(
m
->
object
,
name
,
ap
);
if
(
!
strcmp
(
name
,
"status"
)
&&
(
m
->
object
||
m
->
notify_object
))
{
if
(
m
->
object
)
return
((
m
->
object
->
type
->
signal_handler
))
(
m
->
object
,
name
,
ap
);
else
return
((
m
->
notify_object
->
type
->
signal_handler
))
(
m
->
notify_object
,
name
,
ap
);
}
if
(
h
->
inner
&&
h
->
inner
->
type
->
signal_handler
)
return
(
*
(
h
->
inner
->
type
->
signal_handler
))
(
h
->
inner
,
...
...
@@ -515,7 +532,8 @@ isc_result_t omapi_message_process (omapi_object_t *mo, omapi_object_t *po)
if
(
create
||
update
)
{
status
=
omapi_object_update
(
object
,
(
omapi_object_t
*
)
0
,
message
->
object
);
message
->
object
,
message
->
handle
);
if
(
status
!=
ISC_R_SUCCESS
)
{
omapi_object_dereference
(
&
object
,
"omapi_message_process"
);
...
...
@@ -564,7 +582,8 @@ isc_result_t omapi_message_process (omapi_object_t *mo, omapi_object_t *po)
}
status
=
omapi_object_update
(
object
,
(
omapi_object_t
*
)
0
,
message
->
object
);
message
->
object
,
message
->
handle
);
if
(
status
!=
ISC_R_SUCCESS
)
{
omapi_object_dereference
(
&
object
,
"omapi_message_process"
);
...
...
@@ -620,6 +639,31 @@ isc_result_t omapi_message_process (omapi_object_t *mo, omapi_object_t *po)
if
(
status
==
ISC_R_SUCCESS
)
omapi_value_dereference
(
&
tv
,
"omapi_message_process"
);
return
ISC_R_SUCCESS
;
case
OMAPI_OP_DELETE
:
status
=
omapi_handle_lookup
(
&
object
,
message
->
handle
);
if
(
status
!=
ISC_R_SUCCESS
)
{
return
omapi_protocol_send_status
(
po
,
(
omapi_object_t
*
)
0
,
status
,
message
->
id
,
"no matching handle"
);
}
if
(
!
object
->
type
->
delete
)
return
omapi_protocol_send_status
(
po
,
(
omapi_object_t
*
)
0
,
ISC_R_NOTIMPLEMENTED
,
message
->
id
,
"no delete method for object"
);
status
=
(
*
(
object
->
type
->
delete
))
(
object
,
(
omapi_object_t
*
)
0
);
omapi_object_dereference
(
&
object
,
"omapi_message_process"
);
return
omapi_protocol_send_status
(
po
,
(
omapi_object_t
*
)
0
,
status
,
message
->
id
,
(
char
*
)
0
);
}
return
ISC_R_NOTIMPLEMENTED
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment