The cl-slp Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-slp Reference Manual

This is the cl-slp Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 08:18:20 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

CL-SLP

Common Lisp CFFI bindings to the OpenSLP library. Used for discovering and advertising services over the Service Location Protocol (SLP).

CL-SLP uses the package nickname SLP.

Usage

CL-SLP just wraps the OpenSLP functions, see http://www.openslp.org/doc/html/ProgrammersGuide/index.html for the official API reference.

Before loading the library, ensure your libslp.so (unix) or slp.dll (windows) library is available to be loaded on your system. CL-SLP automatically pushes "C:/program files (x86)/OpenSLP/" onto foreign-library-directories which should enable it to be loaded on Windows.

Note that since SLP attributes map names to a list of values, this function accepts as input an assoc list that maps names to either atoms or lists, e.g. (slp-format-attributes '((:a . 123) (:b 321) (:c 123 456)) -> "(A=123),(B=321),(C=123,456)"

Notes

The OpenSLP library makes extensive use of callbacks in its API. CL-SLP defines a default callback for each of the library calls, which it uses to collect return data. Users of CL-SLP may if they wish define their own callbacks using the macros DEFINE-SERVER-TYPE-CALLBACK, DEFINE-SERVER-URL-CALLBACK, DEFINE-ATTR-CALLBACK and DEFINE-REGISTER-CALLBACK.

They can be called by passing the name of the new callback with the :callback-name keyword parameter to the functions that take it.

The default callbacks should be sufficient for most needs because they just collect all the data available and return it to Lisp.

Note also that you MUST use a Lisp that supports callbacks; CL-SLP was developed and tested using SBCL on Ubuntu Linux and Windows 7.

All the callbacks take an optional argument, COOKIE, that is a pointer to an area of memory for use in return values. This doesn't make much sense in Common Lisp, since we have other ways of returning data from callbacks so it probably should be either ignored or removed from the Lisp calls.

API changes

In earlier versions of CL-SLP the functions FIND-SERVICES, FIND-ALL-SERVICES and FIND-SERVICE-TYPES were slightly misnamed as FIND-SERVERS, FIND-ALL-SERVERS and FIND-SERVER-TYPES. These functions remain but are now deprecated.

Example

;; Find service types
(slp:find-service-types)
-> ("service:wbem:https")

;; Find all servers
(slp:find-all-services)
-> ("service:wbem:https://localhost:5989")

;; Register a service 
(slp:register "service:myservice.x://localhost:8000" :attributes '((:num1 123) (:num2 321)))
-> T

;; Find services on the new service type
(slp:find-services "myservice.x")
-> ("service:myservice.x://localhost:8000")

;; Get attributes (try on a remote machine)
(slp:find-attributes "service:myservice.x://localhost:8000")
-> ((:NUM1 123) (:NUM2 321))

;; On a remote machine using slptool
;; $ slptool findattrs service:myservice.x://localhost:8000
;; (NUM1=123),(NUM2=321)

;; Deregister service
(slp:deregister "service:myservice.x://localhost:8000")
-> T

;; Check it has now gone
(slp:find-services "myservice.x")
-> NIL

Note that the OpenSLP daemon (slpd) must be running for register/deregister functions to work.

Frank James March 2014


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-slp

Author

Frank James <frank.a.james@gmail.com>

License

BSD

Description

Common Lisp OpenSLP package

Dependency

cffi

Source

cl-slp.asd (file)

Component

cl-slp.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-slp.asd

Location

cl-slp.asd

Systems

cl-slp (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-slp/cl-slp.lisp

Parent

cl-slp (system)

Location

cl-slp.lisp

Packages

cl-slp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-slp

Source

cl-slp.lisp (file)

Nickname

slp

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: deregister URL &key CALLBACK-NAME COOKIE

Deregister the service

Package

cl-slp

Source

cl-slp.lisp (file)

Function: escape STR &optional ISTAG

Properly escape SLP strings

Package

cl-slp

Source

cl-slp.lisp (file)

Function: find-all-servers ()
Package

cl-slp

Source

cl-slp.lisp (file)

Function: find-all-services ()

Return a list of the urls of all servers found

Package

cl-slp

Source

cl-slp.lisp (file)

Function: find-attributes URL &key CALLBACK-NAME ATTRIB-IDS SCOPE-LIST COOKIE

Retuns an assoc list of the attributes found for the url specified

Package

cl-slp

Source

cl-slp.lisp (file)

Function: find-scopes ()

Set the list of scopes

Package

cl-slp

Source

cl-slp.lisp (file)

Function: find-server-types &key CALLBACK-NAME NAMING-AUTHORITY SCOPE-LIST COOKIE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: find-servers SERVER-TYPE &key CALLBACK-NAME SCOPE-LIST FILTER COOKIE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: find-service-types ()

Returns a list of server types found

Package

cl-slp

Source

cl-slp.lisp (file)

Function: find-services SERVICE-TYPE

Find all services with specified type

Package

cl-slp

Source

cl-slp.lisp (file)

Function: get-property NAME

Get an SLP property. See *slp-properties* for a list of valid properties

Package

cl-slp

Source

cl-slp.lisp (file)

Function: get-property* ()

Get all SLP properties as an assoc list

Package

cl-slp

Source

cl-slp.lisp (file)

Function: get-refresh-interval ()
Package

cl-slp

Source

cl-slp.lisp (file)

Function: parse-url URL

Parse a service url

Package

cl-slp

Source

cl-slp.lisp (file)

Function: register URL &key CALLBACK-NAME LIFETIME ATTRIBUTES COOKIE

Register a service with SLP. Needs slpd to be installed and running on the system.

Package

cl-slp

Source

cl-slp.lisp (file)

Function: slp-close ()
Package

cl-slp

Source

cl-slp.lisp (file)

Function: slp-open &key LOCALE IS-ASYNC

Initialise access to the OpenSLP library

Package

cl-slp

Source

cl-slp.lisp (file)

Function: unescape STR &optional ISTAG

Unescape SLP strings

Package

cl-slp

Source

cl-slp.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Conditions

Condition: slp-error ()
Package

cl-slp

Source

cl-slp.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: code
Initargs

:code

Initform

(quote 0)

Readers

slp-error-code (generic function)

Slot: message
Initargs

:message

Readers

slp-error-message (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *default-attr-callback*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *default-attr-list*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *default-deregister-callback*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *default-lifetime*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *default-register-callback*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *default-server-type-callback*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *default-server-type-list*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *default-server-url-callback*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *default-server-url-list*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *maximum-lifetime*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *slp-error-messages*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *slp-handle*
Package

cl-slp

Source

cl-slp.lisp (file)

Special Variable: *slp-properties*
Package

cl-slp

Source

cl-slp.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Macros

Macro: define-attr-callback NAME (HANDLE ATTR-LIST ERROR-CODE COOKIE) &body BODY
Package

cl-slp

Source

cl-slp.lisp (file)

Macro: define-register-callback NAME (HANDLE ERROR-CODE COOKIE) &body BODY
Package

cl-slp

Source

cl-slp.lisp (file)

Macro: define-server-type-callback NAME (HANDLE SERVER-TYPES ERROR-CODE COOKIE) &body BODY
Package

cl-slp

Source

cl-slp.lisp (file)

Macro: define-server-url-callback NAME (HANDLE URL LIFETIME ERROR-CODE COOKIE) &body BODY
Package

cl-slp

Source

cl-slp.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: %find-service-types &key CALLBACK-NAME NAMING-AUTHORITY SCOPE-LIST COOKIE

Returns a list of server types found

Package

cl-slp

Source

cl-slp.lisp (file)

Function: %find-services SERVER-TYPE &key CALLBACK-NAME SCOPE-LIST FILTER COOKIE

Returns a list of servers found of the specified type

Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-close HANDLE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-deregister HANDLE URL CALLBACK COOKIE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-escape UNESCAPED ESCAPED ISTAG
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-find-attributes HANDLE URL SCOPE-LIST ATTRIB-IDS CALLBACK COOKIE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-find-scopes HANDLE SCOPE-LIST
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-find-server-types HANDLE NAMING-AUTHORITY SCOPE-LIST CALLBACK COOKIE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-find-servers HANDLE SERVER-TYPE SCOPE-LIST FILTER CALLBACK COOKIE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-free MEM
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-get-property NAME
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-get-refresh-interval ()
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-open LANG IS-ASYNC HANDLE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-parse-url URL SERVER-URL
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-register HANDLE URL LIFETIME SERVER-TYPE ATTRIBUTES FRESH CALLBACK COOKIE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-set-property NAME VALUE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: %slp-unescape ESCAPED UNESCAPE ISTAG
Package

cl-slp

Source

cl-slp.lisp (file)

Function: get-handle ()

Get the handle currently in use by cl-slp

Package

cl-slp

Source

cl-slp.lisp (file)

Function: set-property NAME VALUE

Set an SLP property. This function is ignored by OpenSLP

Package

cl-slp

Source

cl-slp.lisp (file)

Function: slp-format-attributes ATTRIBUTE-ALIST

Format an assoc list of attributes into an slp attribute string

Package

cl-slp

Source

cl-slp.lisp (file)

Function: slp-format-url SERVICE-TYPE ADDRESS

Format an SLP service URL

Package

cl-slp

Source

cl-slp.lisp (file)

Function: slp-free POINTER

Used to free any memory allocated by OpenSLP

Package

cl-slp

Source

cl-slp.lisp (file)

Function: slp-raise-error ERROR-CODE
Package

cl-slp

Source

cl-slp.lisp (file)

Function: split-attribute-string STRING

Split an attribute string into an assoc list. Attr strings are formatted
as (name=value),(name=val1,val2,val3), i.e. comma seperated lists that map names to lists of values

Package

cl-slp

Source

cl-slp.lisp (file)

Function: split-string STRING &optional SPLIT-CHAR
Package

cl-slp

Source

cl-slp.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Generic functions

Generic Function: slp-error-code CONDITION
Package

cl-slp

Methods
Method: slp-error-code (CONDITION slp-error)
Source

cl-slp.lisp (file)

Generic Function: slp-error-message CONDITION
Package

cl-slp

Methods
Method: slp-error-message (CONDITION slp-error)
Source

cl-slp.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Classes

Class: slp-server-url-tclass ()
Package

cl-slp

Source

cl-slp.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)

Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-slp.asd: The cl-slp<dot>asd file
cl-slp/cl-slp.lisp: The cl-slp/cl-slp<dot>lisp file

F
File, Lisp, cl-slp.asd: The cl-slp<dot>asd file
File, Lisp, cl-slp/cl-slp.lisp: The cl-slp/cl-slp<dot>lisp file

L
Lisp File, cl-slp.asd: The cl-slp<dot>asd file
Lisp File, cl-slp/cl-slp.lisp: The cl-slp/cl-slp<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %  
D   E   F   G   M   P   R   S   U  
Index Entry  Section

%
%find-service-types: Internal functions
%find-services: Internal functions
%slp-close: Internal functions
%slp-deregister: Internal functions
%slp-escape: Internal functions
%slp-find-attributes: Internal functions
%slp-find-scopes: Internal functions
%slp-find-server-types: Internal functions
%slp-find-servers: Internal functions
%slp-free: Internal functions
%slp-get-property: Internal functions
%slp-get-refresh-interval: Internal functions
%slp-open: Internal functions
%slp-parse-url: Internal functions
%slp-register: Internal functions
%slp-set-property: Internal functions
%slp-unescape: Internal functions

D
define-attr-callback: Internal macros
define-register-callback: Internal macros
define-server-type-callback: Internal macros
define-server-url-callback: Internal macros
deregister: Exported functions

E
escape: Exported functions

F
find-all-servers: Exported functions
find-all-services: Exported functions
find-attributes: Exported functions
find-scopes: Exported functions
find-server-types: Exported functions
find-servers: Exported functions
find-service-types: Exported functions
find-services: Exported functions
Function, %find-service-types: Internal functions
Function, %find-services: Internal functions
Function, %slp-close: Internal functions
Function, %slp-deregister: Internal functions
Function, %slp-escape: Internal functions
Function, %slp-find-attributes: Internal functions
Function, %slp-find-scopes: Internal functions
Function, %slp-find-server-types: Internal functions
Function, %slp-find-servers: Internal functions
Function, %slp-free: Internal functions
Function, %slp-get-property: Internal functions
Function, %slp-get-refresh-interval: Internal functions
Function, %slp-open: Internal functions
Function, %slp-parse-url: Internal functions
Function, %slp-register: Internal functions
Function, %slp-set-property: Internal functions
Function, %slp-unescape: Internal functions
Function, deregister: Exported functions
Function, escape: Exported functions
Function, find-all-servers: Exported functions
Function, find-all-services: Exported functions
Function, find-attributes: Exported functions
Function, find-scopes: Exported functions
Function, find-server-types: Exported functions
Function, find-servers: Exported functions
Function, find-service-types: Exported functions
Function, find-services: Exported functions
Function, get-handle: Internal functions
Function, get-property: Exported functions
Function, get-property*: Exported functions
Function, get-refresh-interval: Exported functions
Function, parse-url: Exported functions
Function, register: Exported functions
Function, set-property: Internal functions
Function, slp-close: Exported functions
Function, slp-format-attributes: Internal functions
Function, slp-format-url: Internal functions
Function, slp-free: Internal functions
Function, slp-open: Exported functions
Function, slp-raise-error: Internal functions
Function, split-attribute-string: Internal functions
Function, split-string: Internal functions
Function, unescape: Exported functions

G
Generic Function, slp-error-code: Internal generic functions
Generic Function, slp-error-message: Internal generic functions
get-handle: Internal functions
get-property: Exported functions
get-property*: Exported functions
get-refresh-interval: Exported functions

M
Macro, define-attr-callback: Internal macros
Macro, define-register-callback: Internal macros
Macro, define-server-type-callback: Internal macros
Macro, define-server-url-callback: Internal macros
Method, slp-error-code: Internal generic functions
Method, slp-error-message: Internal generic functions

P
parse-url: Exported functions

R
register: Exported functions

S
set-property: Internal functions
slp-close: Exported functions
slp-error-code: Internal generic functions
slp-error-code: Internal generic functions
slp-error-message: Internal generic functions
slp-error-message: Internal generic functions
slp-format-attributes: Internal functions
slp-format-url: Internal functions
slp-free: Internal functions
slp-open: Exported functions
slp-raise-error: Internal functions
split-attribute-string: Internal functions
split-string: Internal functions

U
unescape: Exported functions

Jump to:   %  
D   E   F   G   M   P   R   S   U  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
C   M   S  
Index Entry  Section

*
*default-attr-callback*: Internal special variables
*default-attr-list*: Internal special variables
*default-deregister-callback*: Internal special variables
*default-lifetime*: Internal special variables
*default-register-callback*: Internal special variables
*default-server-type-callback*: Internal special variables
*default-server-type-list*: Internal special variables
*default-server-url-callback*: Internal special variables
*default-server-url-list*: Internal special variables
*maximum-lifetime*: Internal special variables
*slp-error-messages*: Internal special variables
*slp-handle*: Internal special variables
*slp-properties*: Internal special variables

C
code: Exported conditions

M
message: Exported conditions

S
Slot, code: Exported conditions
Slot, message: Exported conditions
Special Variable, *default-attr-callback*: Internal special variables
Special Variable, *default-attr-list*: Internal special variables
Special Variable, *default-deregister-callback*: Internal special variables
Special Variable, *default-lifetime*: Internal special variables
Special Variable, *default-register-callback*: Internal special variables
Special Variable, *default-server-type-callback*: Internal special variables
Special Variable, *default-server-type-list*: Internal special variables
Special Variable, *default-server-url-callback*: Internal special variables
Special Variable, *default-server-url-list*: Internal special variables
Special Variable, *maximum-lifetime*: Internal special variables
Special Variable, *slp-error-messages*: Internal special variables
Special Variable, *slp-handle*: Internal special variables
Special Variable, *slp-properties*: Internal special variables

Jump to:   *  
C   M   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-slp: The cl-slp system
cl-slp: The cl-slp package
Class, slp-server-url-tclass: Internal classes
Condition, slp-error: Exported conditions

P
Package, cl-slp: The cl-slp package

S
slp-error: Exported conditions
slp-server-url-tclass: Internal classes
System, cl-slp: The cl-slp system

Jump to:   C   P   S