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
64
Issues
64
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
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
6a4c4be8
Commit
6a4c4be8
authored
Oct 08, 1999
by
Ted Lemon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Seperate public and private object declarations.
parent
a3621e23
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
61 additions
and
199 deletions
+61
-199
dhcpctl/callback.c
dhcpctl/callback.c
+1
-0
dhcpctl/dhcpctl.c
dhcpctl/dhcpctl.c
+1
-0
dhcpctl/remote.c
dhcpctl/remote.c
+1
-0
dhcpctl/test.c
dhcpctl/test.c
+5
-0
includes/dhcpd.h
includes/dhcpd.h
+1
-0
includes/omapip/alloc.h
includes/omapip/alloc.h
+0
-20
includes/omapip/omapip.h
includes/omapip/omapip.h
+26
-165
omapip/alloc.c
omapip/alloc.c
+1
-1
omapip/buffer.c
omapip/buffer.c
+1
-1
omapip/connection.c
omapip/connection.c
+1
-1
omapip/dispatch.c
omapip/dispatch.c
+9
-3
omapip/generic.c
omapip/generic.c
+1
-1
omapip/handle.c
omapip/handle.c
+1
-1
omapip/listener.c
omapip/listener.c
+1
-1
omapip/message.c
omapip/message.c
+1
-1
omapip/protocol.c
omapip/protocol.c
+1
-1
omapip/result.c
omapip/result.c
+1
-1
omapip/support.c
omapip/support.c
+1
-1
omapip/test.c
omapip/test.c
+5
-0
server/omapi.c
server/omapi.c
+2
-1
No files found.
dhcpctl/callback.c
View file @
6a4c4be8
...
...
@@ -20,6 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip_p.h>
#include "dhcpctl.h"
/* dhcpctl_set_callback
...
...
dhcpctl/dhcpctl.c
View file @
6a4c4be8
...
...
@@ -20,6 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip_p.h>
#include "dhcpctl.h"
omapi_object_type_t
*
dhcpctl_callback_type
;
...
...
dhcpctl/remote.c
View file @
6a4c4be8
...
...
@@ -20,6 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip_p.h>
#include "dhcpctl.h"
/* dhcpctl_new_object
...
...
dhcpctl/test.c
View file @
6a4c4be8
...
...
@@ -20,6 +20,11 @@
* http://www.isc.org for more information.
*/
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <isc/result.h>
#include "dhcpctl.h"
int
main
(
int
,
char
**
);
...
...
includes/dhcpd.h
View file @
6a4c4be8
...
...
@@ -56,6 +56,7 @@
#include "auth.h"
#include "dhctoken.h"
#include <isc/result.h>
#include <omapip/omapip.h>
#if !defined (OPTION_HASH_SIZE)
...
...
includes/omapip/alloc.h
View file @
6a4c4be8
...
...
@@ -20,27 +20,7 @@
* http://www.isc.org for more information.
*/
isc_result_t
omapi_object_reference
(
omapi_object_t
**
,
omapi_object_t
*
,
const
char
*
);
isc_result_t
omapi_object_dereference
(
omapi_object_t
**
,
const
char
*
);
isc_result_t
omapi_buffer_new
(
omapi_buffer_t
**
,
const
char
*
);
isc_result_t
omapi_buffer_reference
(
omapi_buffer_t
**
,
omapi_buffer_t
*
,
const
char
*
);
isc_result_t
omapi_buffer_dereference
(
omapi_buffer_t
**
,
const
char
*
);
isc_result_t
omapi_typed_data_new
(
omapi_typed_data_t
**
,
omapi_datatype_t
,
...);
isc_result_t
omapi_typed_data_reference
(
omapi_typed_data_t
**
,
omapi_typed_data_t
*
,
const
char
*
);
isc_result_t
omapi_typed_data_dereference
(
omapi_typed_data_t
**
,
const
char
*
);
isc_result_t
omapi_data_string_new
(
omapi_data_string_t
**
,
unsigned
,
const
char
*
);
isc_result_t
omapi_data_string_reference
(
omapi_data_string_t
**
,
omapi_data_string_t
*
,
const
char
*
);
isc_result_t
omapi_data_string_dereference
(
omapi_data_string_t
**
,
const
char
*
);
isc_result_t
omapi_value_new
(
omapi_value_t
**
,
const
char
*
);
isc_result_t
omapi_value_reference
(
omapi_value_t
**
,
omapi_value_t
*
,
const
char
*
);
isc_result_t
omapi_value_dereference
(
omapi_value_t
**
,
const
char
*
);
includes/omapip/omapip.h
View file @
6a4c4be8
...
...
@@ -23,49 +23,7 @@
#ifndef _OMAPIP_H_
#define _OMAPIP_H_
#ifndef __CYGWIN32__
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#if defined (NSUPDATE)
# include <arpa/nameser.h>
# include <resolv.h>
#endif
#include <netdb.h>
#else
#define fd_set cygwin_fd_set
#include <sys/types.h>
#endif
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <ctype.h>
#include <time.h>
#include "cdefs.h"
#include "osdep.h"
#include <isc/result.h>
typedef
u_int32_t
omapi_handle_t
;
/* OMAPI protocol header, version 1.00 */
typedef
struct
{
unsigned
authlen
;
/* Length of authenticator. */
unsigned
authid
;
/* Authenticator object ID. */
unsigned
op
;
/* Opcode. */
omapi_handle_t
handle
;
/* Handle of object being operated on,
or zero. */
unsigned
id
;
/* Transaction ID. */
unsigned
rid
;
/* ID of transaction to which this is a response. */
}
omapi_protocol_header_t
;
typedef
unsigned
int
omapi_handle_t
;
struct
__omapi_object
;
typedef
struct
__omapi_object
omapi_object_t
;
...
...
@@ -86,7 +44,7 @@ typedef struct {
#define OMAPI_TYPED_DATA_NOBUFFER_LEN (sizeof (int) + \
sizeof (omapi_datatype_t) + \
sizeof (int))
u
_int8_t
value
[
1
];
u
nsigned
char
value
[
1
];
}
buffer
;
#define OMAPI_TYPED_DATA_OBJECT_LEN (sizeof (int) + \
sizeof (omapi_datatype_t) + \
...
...
@@ -112,7 +70,7 @@ typedef struct {
int
refcnt
;
unsigned
len
;
#define OMAPI_DATA_STRING_EMPTY_SIZE (2 * sizeof (int))
u
_int8_t
value
[
1
];
u
nsigned
char
value
[
1
];
}
omapi_data_string_t
;
typedef
struct
{
...
...
@@ -153,126 +111,8 @@ struct __omapi_object {
OMAPI_OBJECT_PREAMBLE
;
};
/* The port on which applications should listen for OMAPI connections. */
#define OMAPI_PROTOCOL_PORT 7911
#define OMAPI_PROTOCOL_VERSION 100
#define OMAPI_OP_OPEN 1
#define OMAPI_OP_REFRESH 2
#define OMAPI_OP_UPDATE 3
#define OMAPI_OP_NOTIFY 4
#define OMAPI_OP_STATUS 5
#define OMAPI_OP_DELETE 6
#include <omapip/buffer.h>
typedef
enum
{
omapi_connection_unconnected
,
omapi_connection_connecting
,
omapi_connection_connected
,
omapi_connection_disconnecting
,
omapi_connection_closed
}
omapi_connection_state_t
;
typedef
enum
{
omapi_protocol_intro_wait
,
omapi_protocol_header_wait
,
omapi_protocol_signature_wait
,
omapi_protocol_name_wait
,
omapi_protocol_name_length_wait
,
omapi_protocol_value_wait
,
omapi_protocol_value_length_wait
}
omapi_protocol_state_t
;
typedef
struct
__omapi_message_object
{
OMAPI_OBJECT_PREAMBLE
;
struct
__omapi_message_object
*
next
,
*
prev
;
omapi_object_t
*
object
;
omapi_object_t
*
notify_object
;
unsigned
authlen
;
omapi_typed_data_t
*
authenticator
;
unsigned
authid
;
omapi_object_t
*
id_object
;
unsigned
op
;
omapi_handle_t
h
;
unsigned
id
;
unsigned
rid
;
}
omapi_message_object_t
;
typedef
struct
{
OMAPI_OBJECT_PREAMBLE
;
unsigned
header_size
;
unsigned
protocol_version
;
u_int32_t
next_xid
;
omapi_object_t
*
authinfo
;
/* Default authinfo to use. */
omapi_protocol_state_t
state
;
/* Input state. */
int
reading_message_values
;
/* True if reading message-specific
values. */
omapi_message_object_t
*
message
;
/* Incoming message. */
omapi_data_string_t
*
name
;
/* Incoming name. */
omapi_typed_data_t
*
value
;
/* Incoming value. */
}
omapi_protocol_object_t
;
typedef
struct
{
OMAPI_OBJECT_PREAMBLE
;
}
omapi_protocol_listener_object_t
;
typedef
struct
__omapi_connection_object
{
OMAPI_OBJECT_PREAMBLE
;
int
socket
;
/* Connection socket. */
omapi_connection_state_t
state
;
struct
sockaddr_in
remote_addr
;
struct
sockaddr_in
local_addr
;
u_int32_t
bytes_needed
;
/* Bytes of input needed before wakeup. */
u_int32_t
in_bytes
;
/* Bytes of input already buffered. */
omapi_buffer_t
*
inbufs
;
u_int32_t
out_bytes
;
/* Bytes of output in buffers. */
omapi_buffer_t
*
outbufs
;
omapi_object_t
*
listener
;
/* Listener that accepted this
connection, if any. */
}
omapi_connection_object_t
;
typedef
struct
__omapi_listener_object
{
OMAPI_OBJECT_PREAMBLE
;
int
socket
;
/* Connection socket. */
struct
sockaddr_in
address
;
}
omapi_listener_object_t
;
typedef
struct
__omapi_io_object
{
OMAPI_OBJECT_PREAMBLE
;
struct
__omapi_io_object
*
next
;
int
(
*
readfd
)
(
omapi_object_t
*
);
int
(
*
writefd
)
(
omapi_object_t
*
);
isc_result_t
(
*
reader
)
(
omapi_object_t
*
);
isc_result_t
(
*
writer
)
(
omapi_object_t
*
);
isc_result_t
(
*
reaper
)
(
omapi_object_t
*
);
}
omapi_io_object_t
;
typedef
struct
__omapi_generic_object
{
OMAPI_OBJECT_PREAMBLE
;
omapi_value_t
**
values
;
int
nvalues
,
va_max
;
}
omapi_generic_object_t
;
typedef
struct
__omapi_waiter_object
{
OMAPI_OBJECT_PREAMBLE
;
int
ready
;
struct
__omapi_waiter_object
*
next
;
}
omapi_waiter_object_t
;
#define OMAPI_HANDLE_TABLE_SIZE 120
typedef
struct
__omapi_handle_table
{
omapi_handle_t
first
,
limit
;
omapi_handle_t
next
;
int
leafp
;
union
{
omapi_object_t
*
object
;
struct
__omapi_handle_table
*
table
;
}
children
[
OMAPI_HANDLE_TABLE_SIZE
];
}
omapi_handle_table_t
;
#include <omapip/alloc.h>
isc_result_t
omapi_protocol_connect
(
omapi_object_t
*
,
const
char
*
,
int
,
omapi_object_t
*
);
...
...
@@ -368,7 +208,7 @@ isc_result_t omapi_register_io_object (omapi_object_t *,
isc_result_t
(
*
)(
omapi_object_t
*
));
isc_result_t
omapi_dispatch
(
struct
timeval
*
);
isc_result_t
omapi_wait_for_completion
(
omapi_object_t
*
,
struct
timeval
*
);
isc_result_t
omapi_one_dispatch
(
omapi_
waiter_
object_t
*
,
struct
timeval
*
);
isc_result_t
omapi_one_dispatch
(
omapi_object_t
*
,
struct
timeval
*
);
isc_result_t
omapi_io_set_value
(
omapi_object_t
*
,
omapi_object_t
*
,
omapi_data_string_t
*
,
omapi_typed_data_t
*
);
...
...
@@ -501,4 +341,25 @@ isc_result_t omapi_object_handle (omapi_handle_t *, omapi_object_t *);
isc_result_t
omapi_handle_lookup
(
omapi_object_t
**
,
omapi_handle_t
);
isc_result_t
omapi_handle_td_lookup
(
omapi_object_t
**
,
omapi_typed_data_t
*
);
isc_result_t
omapi_object_reference
(
omapi_object_t
**
,
omapi_object_t
*
,
const
char
*
);
isc_result_t
omapi_object_dereference
(
omapi_object_t
**
,
const
char
*
);
isc_result_t
omapi_typed_data_new
(
omapi_typed_data_t
**
,
omapi_datatype_t
,
...);
isc_result_t
omapi_typed_data_reference
(
omapi_typed_data_t
**
,
omapi_typed_data_t
*
,
const
char
*
);
isc_result_t
omapi_typed_data_dereference
(
omapi_typed_data_t
**
,
const
char
*
);
isc_result_t
omapi_data_string_new
(
omapi_data_string_t
**
,
unsigned
,
const
char
*
);
isc_result_t
omapi_data_string_reference
(
omapi_data_string_t
**
,
omapi_data_string_t
*
,
const
char
*
);
isc_result_t
omapi_data_string_dereference
(
omapi_data_string_t
**
,
const
char
*
);
isc_result_t
omapi_value_new
(
omapi_value_t
**
,
const
char
*
);
isc_result_t
omapi_value_reference
(
omapi_value_t
**
,
omapi_value_t
*
,
const
char
*
);
isc_result_t
omapi_value_dereference
(
omapi_value_t
**
,
const
char
*
);
#endif
/* _OMAPIP_H_ */
omapip/alloc.c
View file @
6a4c4be8
...
...
@@ -21,7 +21,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
isc_result_t
omapi_object_reference
(
omapi_object_t
**
r
,
omapi_object_t
*
h
,
...
...
omapip/buffer.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
/* Make sure that at least len bytes are in the input buffer, and if not,
read enough bytes to make up the difference. */
...
...
omapip/connection.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
isc_result_t
omapi_connect
(
omapi_object_t
*
c
,
const
char
*
server_name
,
...
...
omapip/dispatch.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
static
omapi_io_object_t
omapi_io_states
;
u_int32_t
cur_time
;
...
...
@@ -137,7 +137,7 @@ isc_result_t omapi_wait_for_completion (omapi_object_t *object,
waiter
=
(
omapi_waiter_object_t
*
)
0
;
do
{
status
=
omapi_one_dispatch
(
waiter
,
t
);
status
=
omapi_one_dispatch
(
(
omapi_object_t
*
)
waiter
,
t
);
if
(
status
!=
ISC_R_SUCCESS
)
return
status
;
}
while
(
!
waiter
||
!
waiter
->
ready
);
...
...
@@ -164,7 +164,7 @@ isc_result_t omapi_wait_for_completion (omapi_object_t *object,
return
ISC_R_SUCCESS
;
}
isc_result_t
omapi_one_dispatch
(
omapi_
waiter_object_t
*
waiter
,
isc_result_t
omapi_one_dispatch
(
omapi_
object_t
*
wo
,
struct
timeval
*
t
)
{
fd_set
r
,
w
,
x
;
...
...
@@ -174,6 +174,12 @@ isc_result_t omapi_one_dispatch (omapi_waiter_object_t *waiter,
struct
timeval
now
,
to
;
omapi_io_object_t
*
io
,
*
prev
;
isc_result_t
status
;
omapi_waiter_object_t
*
waiter
;
if
(
!
wo
||
wo
->
type
!=
omapi_type_waiter
)
waiter
=
(
omapi_waiter_object_t
*
)
0
;
else
waiter
=
(
omapi_waiter_object_t
*
)
wo
;
FD_ZERO
(
&
x
);
...
...
omapip/generic.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
isc_result_t
omapi_generic_new
(
omapi_object_t
**
gen
,
const
char
*
name
)
{
...
...
omapip/handle.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
/* The handle table is a hierarchical tree designed for quick mapping
of handle identifiers to objects. Objects contain their own handle
...
...
omapip/listener.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
isc_result_t
omapi_listen
(
omapi_object_t
*
h
,
int
port
,
...
...
omapip/message.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
omapi_message_object_t
*
omapi_registered_messages
;
...
...
omapip/protocol.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
isc_result_t
omapi_protocol_connect
(
omapi_object_t
*
h
,
const
char
*
server_name
,
...
...
omapip/result.c
View file @
6a4c4be8
...
...
@@ -21,7 +21,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
static
const
char
*
text
[
ISC_R_NRESULTS
]
=
{
"success"
,
/* 0 */
...
...
omapip/support.c
View file @
6a4c4be8
...
...
@@ -20,7 +20,7 @@
* http://www.isc.org for more information.
*/
#include <omapip/omapip.h>
#include <omapip/omapip
_p
.h>
omapi_object_type_t
*
omapi_type_connection
;
omapi_object_type_t
*
omapi_type_listener
;
...
...
omapip/test.c
View file @
6a4c4be8
...
...
@@ -20,6 +20,11 @@
* http://www.isc.org for more information.
*/
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <isc/result.h>
#include <omapip/omapip.h>
int
main
(
int
argc
,
char
**
argv
)
...
...
server/omapi.c
View file @
6a4c4be8
...
...
@@ -29,10 +29,11 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: omapi.c,v 1.1
5 1999/10/07 06:36:3
5 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: omapi.c,v 1.1
6 1999/10/08 03:43:1
5 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
#endif
/* not lint */
#include "dhcpd.h"
#include <omapip/omapip_p.h>
omapi_object_type_t
*
dhcp_type_lease
;
omapi_object_type_t
*
dhcp_type_group
;
...
...
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