Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 0e4a4b6972
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 537 lines (515 sloc) 22.892 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537
#lang racket/base

#|

UPnP Client Library for Racket
upnp-client.rkt

This file is part of rkt-upnp.
This file is subject to the terms of a MIT-style license, please
refer to LICENSE.txt for details.

How it (should) work:

(define d (upnp-discovery))
(define s (upnp-search-service-srvid d "urn:upnp-org:serviceId:WANIPConn1"))
(define c (upnp-control-lambda s))
; TODO: below
(define get-external-ip (c "GetExternalIPAddress" '("NewExternalIPAddress")))
(define add-port-mapping (c "AddPortMapping" '() "NewRemoteHost" "NewExternalPort" "NewProtocol" "NewInternalPort" "NewInternalClient" "NewEnabled" "NewPortMappingDescription" "NewLeaseDuration"))
And then use (get-external-ip) to get the external ip, or use (add-port-mapping ...) with the parameters
|#

(require racket/match
         racket/list
         racket/bool
         racket/udp
         net/url
         xml
         "soap.rkt")

(define USER_AGENT "Racket UPnP")

#|
parse-httpu
Parse UDP-HTTP into 3 values:
* Service URL
* Unique Service Name (USN)
* Search Target (ST)
|#
(define (parse-httpu cnt)
  (let* ([sp (open-input-string (bytes->string/utf-8 cnt))]
         [rpc (read-line sp 'any)]
         [f-loc #f]
         [f-usn #f]
         [f-st #f])
    (match rpc
      [[regexp #rx"^(?i:HTTP/[0-9.]+) +200([^0-9].*)$" [list _ _]]
       (let loop ([a (read-line sp 'any)])
         (unless (eof-object? a)
           (match a
             ["" (void)]
             [[regexp #rx"^([^: ]+): *(.*)$" [list _ mf mv]]
              (match (list (string-upcase mf) mv)
                [`["AL" ,y] (void)]
                [`["ST" ,y]
                 (set! f-st y)
                 ]
                [`["01-NLS" ,y] (void)]
                [`["LOCATION" ,y]
                 (match y
                   [[regexp "http://.+" (list _)]
                    (set! f-loc y)]
                   [[regexp "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+:?[0-9]*$" (list _)]
                    (set! f-loc (format "http://~a/" y))]
                   [_ (void)]
                   )
                 ]
                [`["CACHE-CONTROL" ,y] (void)]
                [`["USN" ,y]
                 (set! f-usn y)
                 ]
                [`["SERVER" ,y] (void)]
                [`["EXT" ,y] (void)]
                [`["OPT" ,y] (void)]
                [`["DATE" ,y] (void)]
                [`["X-USER-AGENT" ,y] (void)]
                [_ (void)] )])
           (loop (read-line sp 'any)) ))]
      [_ (void)] )
    (values f-loc f-usn f-st) )
  )

#|
upnp-discovery
Perform UPnP Discovery
|#
(define (upnp-discovery)
  (let ([hshset (make-hash)] ; key: url-location value: #t
        [hshst (make-hash)] ; key: url-location value: list of Search Targets (ST)
        [hshusn (make-hash)]) ; key: url-location value: list of Unique Service Names (USN)
    (thread
     (lambda()
       (define (storeresponse rip rpo cnt)
         (let-values ([(f-loc f-usn f-st) (parse-httpu cnt)])
           (when (not (equal? #f f-loc))
             (hash-set! hshset f-loc #t)
             (hash-set! hshusn f-loc (cons f-usn (hash-ref hshusn f-loc '())))
             (hash-set! hshst f-loc (cons f-st (hash-ref hshst f-loc '())))
             ))
         )
       (let*([ssdpip "239.255.255.250"]
             [ssdpport 1900]
             [randport 32322] ; TODO: Make random port
             [us (udp-open-socket)]
             [bf (make-bytes 2048)]
             [ssdpqry (string->bytes/utf-8
                       (string-append
                        "M-SEARCH * HTTP/1.1\r\n"
                        "HOST: " ssdpip ":" (number->string ssdpport) "\r\n"
                        "MAN: \"ssdp:discover\"\r\n"
                        "MX: 10\r\n"
                        "ST: ssdp:all\r\n"
                        "\r\n"))])
         (udp-bind! us "0.0.0.0" randport) ; make random port number
         (udp-send-to us ssdpip ssdpport ssdpqry)
         (let loop ()
           (let-values ([(l rip rpo) (udp-receive! us bf)])
             (storeresponse rip rpo (subbytes bf 0 l))
             )
           (loop))))
     )
    (lambda (cmd)
      (case cmd
        ['stop
         ; TODO: stop and dispose UDP listener thread
         #t]
        ['list
         (map (lambda (u0)
                (let ([u (car u0)])
                  (list u (hash-ref hshst u '()) (hash-ref hshusn u '()))))
              (hash->list hshset))
         ])))
  )

#|
upnp-search-service-proc
Search incoming service announcements using proc as predicate.
|#
; (define s (upnp-search-service-srvtype d "service:WANIPConnection:1"))
; TODO: Change d0 to handle list of discovered devices
(define (upnp-search-service-proc d filtproc)
  (let ([lst (d 'list)])
    (let loop ([l lst])
      (if (equal? '() l)
          #f
          (let ([r (upnp-search-service-proc/one-url (first (first l)) filtproc)])
            (if (procedure? r)
                r
                (if (equal? '() (rest l))
                    #f
                    (loop (rest l))))))))
  )

#|
upnp-search-service-proc/one-url
Search service announcements available from one service listing URL.
|#
(define (upnp-search-service-proc/one-url urlreq filtproc)
  (with-handlers ([exn:fail? (λ (e) #f)])
    (call/cc
     (lambda (return)
       (let* ( [hdrs `(,(format "User-Agent: ~a" USER_AGENT)
                       "Connection: close"
                       "Accept: text/html, text/xml; q=.2, */*; q=.2"
                       "Content-type: application/x-www-form-urlencoded")]
               [inp (get-pure-port (string->url urlreq) hdrs)]
               [d (xml->xexpr (document-element (read-xml inp)))]
               [location urlreq] )
         (define (decode-desc-dvlst a)
           (let ( [devtype #f] [frdname #f]
                               [mfg #f] [mfgurl #f] [mfgdesc #f]
                               [mdlname #f] [udn #f] [prsurl #f]
                               [srvs '()] )
             (match a
               [`((xmlns ,y)) (match y ["urn:schemas-upnp-org:device-1-0" #f])]
               [`(specVersion () ,specversion ...)
                (for ([t specversion])
                  (match t
                    [`(major () ,maj) (void)]
                    [`(minor () ,min) (void)]
                    [_ (void)]
                    ))
                #f
                ]
               [`(device () ,devinfo ...)
                (for ([b devinfo])
                  (define (decode-desc-srvlst c)
                    (let ( [srvtype #f] [srvid #f]
                                        [ctlurl #f] [evturl #f] [scpdurl #f] )
                      (match c
                        [`(service () ,srvinf ...)
                         (for ([e srvinf])
                           (match e
                             [`(serviceType () ,y)
                              (set! srvtype y) ; e.g. "urn:schemas-upnp-org:service:WANIPConnection:1"
                              ]
                             [`(serviceId () ,y)
                              (set! srvid y) ; e.g. "urn:upnp-org:serviceId:WANIPConnection"
                              ]
                             [`(controlURL () ,y)
                              (set! ctlurl y) ; e.g. "/upnp/control1"
                              ]
                             [`(eventSubURL () ,y)
                              (set! evturl y) ; e.g. "/WANIPConnection"
                              ]
                             [`(SCPDURL () ,y)
                              (set! scpdurl y) ; e.g. "http://192.168.0.1:80/serv3.xml"
                              ]
                             [_ (void)]
                             )
                           )
                         (list srvtype srvid ctlurl evturl scpdurl)
                         ]
                        [_ #f]
                        )
                      )
                    )
                  (match b
                    [`(deviceType () ,y)
                     (set! devtype y) ; e.g. "urn:schemas-upnp-org:device:WANConnectionDevice:1"
                     ]
                    [`(friendlyName () ,y)
                     (set! frdname y) ; e.g. "WAN Connection Device"
                     ]
                    [`(manufacturer () ,y)
                     (set! mfg y) ; e.g. "D-Link"
                     ]
                    [`(manufacturerURL () ,y)
                     (set! mfgurl y) ; e.g. "http://www.dlink.com"
                     ]
                    [`(modelDescription () ,y)
                     (set! mfgdesc y) ; e.g. "Residential Gateway"
                     ]
                    [`(modelName () ,y)
                     (set! mdlname y) ; e.g. "Residential Gateway Device"
                     ]
                    [`(UDN () ,y)
                     (set! udn y) ; e.g. "uuid:000F3D19-AF81-0000-0000-0002C0A80001"
                     ]
                    [`(presentationURL () ,y)
                     (set! prsurl y) ; e.g. "http://192.168.0.1:80/"
                     ]
                    [`(serviceList () ,srvlst ...)
                     (set! srvs (filter-not false? (map decode-desc-srvlst srvlst)))
                     ]
                    [`(deviceList () ,dvlst ...)
                     (for-each decode-desc-dvlst dvlst)
                     ]
                    [_ (void)]
                    )
                  )
                (for/list ([j srvs])
                  (match j
                    [`[,srvtype ,srvid ,ctlurl ,evturl ,scpdurl]
                     (when (filtproc location devtype srvtype srvid udn frdname
                                     scpdurl ctlurl evturl prsurl
                                     mfg mfgurl mfgdesc mdlname)
                       (return
                        (lambda()
                          (values location devtype srvtype srvid udn frdname
                                  scpdurl ctlurl evturl prsurl
                                  mfg mfgurl mfgdesc mdlname))))
                     ]))
                ]
               [_ #f])
             )
           )
         ;(printf "~s~n~n" d)
         (for-each decode-desc-dvlst d)
         ))))
  )

(define (upnp-search-service-srvid d svu)
  (let ([srx (regexp (string-append svu "$"))])
    (upnp-search-service-proc
     d (lambda (location devtype srvtype srvid udn frdname scpdurl ctlurl evturl prsurl mfg mfgurl mfgdesc mdlname)
         (printf "~s ?= ~s -> ~s~n" srx srvid (regexp-match srx srvid))
         (if (regexp-match srx srvid)
             #t
             #f ))))
  )

(define (upnp-search-service-udnsrvid d ud svu)
  (let ([srx (regexp (string-append svu "$"))])
    (upnp-search-service-proc
     d (lambda (location devtype srvtype srvid udn frdname scpdurl ctlurl evturl prsurl mfg mfgurl mfgdesc mdlname)
         (if (and (equal? ud udn) (regexp-match srx srvid))
             #t
             #f )))
    )
  )
(define (upnp-search-service-devsrvtype d dev srv)
  (let ([drx (regexp (string-append dev "$"))]
        [srx (regexp (string-append srv "$"))])
    (upnp-search-service-proc
     d (lambda (location devtype srvtype srvid udn frdname scpdurl ctlurl evturl prsurl mfg mfgurl mfgdesc mdlname)
         (if (and (regexp-match drx devtype) (regexp-match srx srvtype))
             #t
             #f ))))
  )

(define (upnp-search-service-srvtype d srv)
  (let ([srx (regexp (string-append srv "$"))])
    (upnp-search-service-proc
     d (lambda (location devtype srvtype srvid udn frdname scpdurl ctlurl evturl prsurl mfg mfgurl mfgdesc mdlname)
         (if (regexp-match srx srvtype)
             #t
             #f ))))
  )

#|
upnp-control-lambda
Create a new procedure-creating procedure from a specific service
|#
(define (upnp-control-lambda s)
  (let-values ([(location devtype srvtype srvid udn frdname
                          rel*scpdurl rel*ctlurl rel*evturl prsurl
                          mfg mfgurl mfgdesc mdlname) (s)])
    (let* ([abs*scpdurl (combine-url/relative (string->url location) rel*scpdurl)]
           [abs*ctlurl (combine-url/relative (string->url location) rel*ctlurl)]
           [abs*evturl (combine-url/relative (string->url location) rel*evturl)]
           [hdrs `(,(format "User-Agent: ~a" USER_AGENT)
                   "Connection: close"
                   "Accept: text/html, text/xml; q=.2, */*; q=.2"
                   "Content-type: application/x-www-form-urlencoded")]
           [vam (let () (write (url->string abs*scpdurl)))]
           [inp (get-pure-port abs*scpdurl hdrs)]
           [d (xml->xexpr (document-element (read-xml inp)))]
           [hshact (make-hash)]
           [hshvar (make-hash)] )
      (for ([a d])
        (define (decode-scpd-aclst b)
          (let ([e-nam #f]
                [e-als #f])
            (match b
              [`(action () ,actinflst ...)
               (for ([e actinflst])
                 (define (decode-scpd-aclst-act-arglist f)
                   (let ([g-stv #f]
                         [g-nam #f]
                         [g-dir #f])
                     (match f
                       [`(argument () ,arg ...)
                        (for ([g arg])
                          (match g
                            [`(relatedStateVariable () ,y) (set! g-stv y)]
                            [`(name () ,y) (set! g-nam y)]
                            [`(direction () ,y)
                             (set! g-dir (match y
                                           ["in" 'in]
                                           ["out" 'out]
                                           ))
                             ]
                            [_ (void)]
                            )
                          )
                        (list g-dir g-nam g-stv)
                        ]
                       [_ #f])
                     )
                   )
                 (match e
                   [`(argumentList () ,arglst ...)
                    (set! e-als (filter-not false? (map decode-scpd-aclst-act-arglist arglst)))
                    ]
                   [`(name () ,y) (set! e-nam y)]
                   [_ (void)]
                   )
                 )
               (hash-set! hshact e-nam e-als)
               ]
              [_ (void)])))
        
        (define (decode-scpd-stttbl b)
          (let ([c-dvl #f]
                [c-vls #f]
                [c-nam #f]
                [c-typ #f])
            (match b
              [`(stateVariable ((sendEvents ,se)) ,sttvarinf ...)
               (for ([c sttvarinf])
                 (define (decode-scpd-stttbl-var-vallst d)
                   (match d
                     [`(allowedValue () ,y) y]
                     [_ #f]
                     )
                   )
                 (match c
                   [`(defaultValue () ,y)
                    (set! c-dvl y)
                    ]
                   [`(allowedValueList () ,vallst ...)
                    (set! c-vls (filter-not false? (map decode-scpd-stttbl-var-vallst vallst)))
                    ]
                   [`(name () ,y)
                    (set! c-nam y)
                    ]
                   [`(dataType () ,y)
                    (set! c-typ (match y
                                  ["boolean" 'bool]
                                  ["string" 'string]
                                  ["ui2" 'ui2]
                                  ["ui4" 'ui4] ))
                    ]
                   [_ (void)]
                   )
                 )
               (hash-set! hshvar c-nam (list c-typ c-dvl c-vls))
               ]
              [_ (void)]
              )
            )
          )
        (match a
          [`((xmlns ,y)) (match y ["urn:schemas-upnp-org:service-1-0" (void)])]
          [`(specVersion () ,specversion)
           (for ([t specversion])
             (match t
               [`(major () ,maj) (void)]
               [`(minor () ,min) (void)]
               [_ (void)]
               ))
           ]
          [`(actionList () ,aclst ...)
           (for-each decode-scpd-aclst aclst)]
          [`(serviceStateTable () ,stttbl ...)
           (for-each decode-scpd-stttbl stttbl)]
          [_ (void)]
          )
        )
      (lambda (arg0 . args)
        ; TODO: Generate lambdas of UPnP actions:
        ; (define scpd (decode-scpd ... ))
        (match (cons arg0 args)
          ; (scpd "AddPortMapping" '() "NewRemoteHost" "NewExternalPort" "NewProtocol" "NewInternalPort" "NewInternalClient" "NewEnabled" "NewPortMappingDescription" "NewLeaseDuration")
          [`[,act (,r ...) ,a ...]
           (let* ([ha (hash-ref hshact act)]
                  [ai (map (lambda (z)
                             (let loop ([hha ha])
                               (if (and (equal? 'in (first (first hha)))
                                        (equal? z (second (first hha))))
                                   (second (first hha))
                                   (if (empty? hha)
                                       (raise "Could not find In argument")
                                       (loop (rest hha)))))
                             ) a)]
                  [ar (map (lambda (z)
                             (let loop ([hha ha])
                               (if (and (equal? 'out (first (first hha)))
                                        (equal? z (second (first hha))))
                                   (second (first hha))
                                   (if (empty? hha)
                                       (raise "Could not find Out argument")
                                       (loop (rest hha)))))
                             ) r)])
             ;(memq 'a '(a b c))
             (lambda args/in
               (when (not (eq? (length args/in) (length ai)))
                 (raise "Input argument mismatch")
                 )
               (let* ([saargs (map (lambda (a b) `(,(string->symbol a) () ,b)) ai args/in)]
                      [soapac (format "~a#~a" srvtype act)]
                      [saenvb `(,(string->symbol (format "u:~a" act)) ((xmlns:u ,srvtype)) ,@saargs)]
                      [soapnv (soap-encode `(,saenvb) #f
                                           "http://schemas.xmlsoap.org/soap/envelope/"
                                           "http://schemas.xmlsoap.org/soap/encoding/")]
                      [fresp "<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body><m:GetGenericPortMappingEntryResponse xmlns:m=\"urn:schemas-upnp-org:service:WANIPConnection:1\"><NewRemoteHost></NewRemoteHost><NewExternalPort>16293</NewExternalPort><NewProtocol>TCP</NewProtocol><NewInternalPort>16293</NewInternalPort><NewInternalClient>192.168.0.132</NewInternalClient><NewEnabled>1</NewEnabled><NewPortMappingDescription>LimeTCP4BC4CD2E33</NewPortMappingDescription><NewLeaseDuration>0</NewLeaseDuration></m:GetGenericPortMappingEntryResponse></s:Body></s:Envelope>"])
                 (define (handle-fault fcode fstr factor fdetl)
                   (printf "Fault happened: ~s~n~s~n~s~n~s~n" fcode fstr factor fdetl))
                 ; TODO: Implement actual UPnP call
                 (printf "POST ~a~nSOAPAction: ~s~nContent-Type: text/xml; charset=\"utf-8\"~nUser-Agent: ~a~n~n~a~n -> ~s~n~n"
                         rel*ctlurl soapac USER_AGENT soapnv ar)
                 (let-values ([(rb rh ns en) (soap-decode fresp handle-fault)])
                   (let ([respargs (cddr (first rb))]
                         [argoutset (make-hash)])
                     (for ([z respargs])
                       (match z
                         [`[,argo () ,argval]
                          (hash-set! argoutset (symbol->string argo) argval)
                          ]
                         [_ (void)]
                         ))
                     (apply values (map (lambda (z)
                                          (hash-ref argoutset z #f))
                                        ar)))))))]
          ; (scpd 'event "ConnectionType" (lambda(v) (void)))
          [`[event ,var ,proc]
           (printf "c: ~s evt ~s ~s -- ~s~n" abs*evturl var proc (hash-ref hshvar var))]))))
  )

#|
((c "SetConnectionType" '() "NewConnectionType") "")
((c "GetConnectionTypeInfo" '("NewConnectionType" "NewPossibleConnectionTypes")))
((c "ForceTermination" '()))
((c "RequestConnection" '()))
((c "GetStatusInfo" '("NewConnectionStatus" "NewLastConnectionError" "NewUptime")))
((c "GetNATRSIPStatus" '("NewRSIPAvailable" "NewNATEnabled")))
((c "GetGenericPortMappingEntry" '("NewRemoteHost" "NewExternalPort" "NewProtocol" "NewInternalPort" "NewInternalClient" "NewEnabled" "NewPortMappingDescription" "NewLeaseDuration") "NewPortMappingIndex") "")
((c "GetSpecificPortMappingEntry" '("NewInternalPort" "NewInternalClient" "NewEnabled" "NewPortMappingDescription" "NewLeaseDuration") "NewRemoteHost" "NewExternalPort" "NewProtocol") "NewRemoteHost" "NewExternalPort" "NewProtocol")
((c "AddPortMapping" '() "NewRemoteHost" "NewExternalPort" "NewProtocol" "NewInternalPort" "NewInternalClient" "NewEnabled" "NewPortMappingDescription" "NewLeaseDuration") "NewRemoteHost" "NewExternalPort" "NewProtocol" "NewInternalPort" "NewInternalClient" "NewEnabled" "NewPortMappingDescription" "NewLeaseDuration")
((c "DeletePortMapping" '() "NewRemoteHost" "NewExternalPort" "NewProtocol") "NewRemoteHost" "NewExternalPort" "NewProtocol")
((c "GetExternalIPAddress" '("NewExternalIPAddress")))

(c 'event "ConnectionType" (lambda(v) (void)))
(c 'event "PossibleConnectionTypes" (lambda(v) (void)))
(c 'event "ConnectionStatus" (lambda(v) (void)))
(c 'event "Uptime" (lambda(v) (void)))
(c 'event "LastConnectionError" (lambda(v) (void)))
(c 'event "RSIPAvailable" (lambda(v) (void)))
(c 'event "NATEnabled" (lambda(v) (void)))
(c 'event "ExternalIPAddress" (lambda(v) (void)))
(c 'event "PortMappingNumberOfEntries" (lambda(v) (void)))
(c 'event "PortMappingEnabled" (lambda(v) (void)))
(c 'event "PortMappingLeaseDuration" (lambda(v) (void)))
(c 'event "RemoteHost" (lambda(v) (void)))
(c 'event "ExternalPort" (lambda(v) (void)))
(c 'event "InternalPort" (lambda(v) (void)))
(c 'event "PortMappingProtocol" (lambda(v) (void)))
(c 'event "InternalClient" (lambda(v) (void)))
(c 'event "PortMappingDescription" (lambda(v) (void)))
|#

; Services:
; "urn:upnp-org:serviceId:WANIPConnection"
; "urn:upnp-org:serviceId:WANIPConn1"
; "urn:upnp-org:serviceId:WANPPPConn1"
; "urn:upnp-org:serviceId:WANCommonIFC1"
; "urn:upnp-org:serviceId:Layer3Forwarding:11"

;(module+ main
; (define d (upnp-discovery))
; (define s (upnp-search-service-srvid d "urn:upnp-org:serviceId:WANIPConn1"))
; (define c (upnp-control-lambda s))
; c
; )
Something went wrong with that request. Please try again.