# PaCkAgE DaTaStReAm neon 1 4506 # end of header 0707010005ff92000081a40000000000000000000000014cbd2ddd0000010d000000b500010002ffffffffffffffff0000000d00000000neon/pkginfo PKG=neon NAME=neon 0.29.4 i86pc Solaris 10 VERSION=0.29.4 PSTAMP=11th October 2010 VENDOR=The WebDAV Project EMAIL=http://www.webdav.org/neon DESC=neon HTTP and WebDAV client library ARCH=i386 CATEGORY=utility CLASSES=none BASEDIR=/ ISTATES=S s 1 2 3 RSTATES=S s 1 2 3 0707010005ff91000081a40000000000000000000000014cbd2dde0000454a000000b500010002ffffffffffffffff0000000c00000000neon/pkgmap : 1 4506 1 d none /usr ? ? ? 1 d none /usr/local ? ? ? 1 d none /usr/local/bin 0755 root root 1 f none /usr/local/bin/neon-config 0755 root root 2050 27326 1287466446 1 d none /usr/local/include 0755 root root 1 d none /usr/local/include/neon 0755 root root 1 f none /usr/local/include/neon/ne_207.h 0644 root root 4418 36713 1287466445 1 f none /usr/local/include/neon/ne_acl.h 0644 root root 1455 52952 1287466445 1 f none /usr/local/include/neon/ne_acl3744.h 0644 root root 2735 19094 1287466445 1 f none /usr/local/include/neon/ne_alloc.h 0644 root root 1880 28884 1287466445 1 f none /usr/local/include/neon/ne_auth.h 0644 root root 5617 25875 1287466445 1 f none /usr/local/include/neon/ne_basic.h 0644 root root 6148 45315 1287466445 1 f none /usr/local/include/neon/ne_compress.h 0644 root root 1746 18274 1287466445 1 f none /usr/local/include/neon/ne_dates.h 0644 root root 1646 4791 1287466445 1 f none /usr/local/include/neon/ne_defs.h 0644 root root 1944 29898 1287466445 1 f none /usr/local/include/neon/ne_i18n.h 0644 root root 2008 39818 1287466445 1 f none /usr/local/include/neon/ne_locks.h 0644 root root 6325 20559 1287466445 1 f none /usr/local/include/neon/ne_md5.h 0644 root root 3920 4880 1287466445 1 f none /usr/local/include/neon/ne_pkcs11.h 0644 root root 4812 54700 1287466445 1 f none /usr/local/include/neon/ne_props.h 0644 root root 10005 20040 1287466445 1 f none /usr/local/include/neon/ne_redirect.h 0644 root root 1515 62708 1287466445 1 f none /usr/local/include/neon/ne_request.h 0644 root root 14411 53392 1287466445 1 f none /usr/local/include/neon/ne_session.h 0644 root root 14933 25826 1287466445 1 f none /usr/local/include/neon/ne_socket.h 0644 root root 12132 54375 1287466445 1 f none /usr/local/include/neon/ne_ssl.h 0644 root root 8175 54546 1287466445 1 f none /usr/local/include/neon/ne_string.h 0644 root root 7484 41940 1287466445 1 f none /usr/local/include/neon/ne_uri.h 0644 root root 3905 4249 1287466445 1 f none /usr/local/include/neon/ne_utils.h 0644 root root 4102 8013 1287466445 1 f none /usr/local/include/neon/ne_xml.h 0644 root root 6806 49304 1287466445 1 f none /usr/local/include/neon/ne_xmlreq.h 0644 root root 1973 36605 1287466445 1 d none /usr/local/lib 0755 root root 1 f none /usr/local/lib/libneon.a 0644 root root 626908 60308 1287466445 1 f none /usr/local/lib/libneon.la 0755 root root 1132 34195 1287466445 1 s none /usr/local/lib/libneon.so=libneon.so.27.2.4 1 s none /usr/local/lib/libneon.so.27=libneon.so.27.2.4 1 f none /usr/local/lib/libneon.so.27.2.4 0755 root root 547704 48506 1287466445 1 d none /usr/local/lib/pkgconfig 0755 root root 1 f none /usr/local/lib/pkgconfig/neon.pc 0644 root root 487 42795 1287466446 1 d none /usr/local/share 0755 root root 1 d none /usr/local/share/doc 0755 root root 1 d none /usr/local/share/doc/neon-0.29.4 0755 root root 1 d none /usr/local/share/doc/neon-0.29.4/html 0755 root root 1 f none /usr/local/share/doc/neon-0.29.4/html/api.html 0644 root root 2553 26430 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/biblio.html 0644 root root 5015 45393 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/compliance.html 0644 root root 5427 13907 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/features.html 0644 root root 4698 31608 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/index.html 0644 root root 10881 175 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/intro.html 0644 root root 3547 49000 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/ref.html 0644 root root 7416 27825 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refalloc.html 0644 root root 4989 50967 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refauth.html 0644 root root 6019 12157 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbuf.html 0644 root root 3586 56699 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbufapp.html 0644 root root 5135 62023 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbufcr.html 0644 root root 3371 35735 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbufdest.html 0644 root root 4096 34899 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbufutil.html 0644 root root 3956 24820 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refcert.html 0644 root root 5991 9324 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refclicert.html 0644 root root 8023 57774 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refconfig.html 0644 root root 5207 62800 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/referr.html 0644 root root 4408 62321 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/reffeat.html 0644 root root 4134 34780 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refgetst.html 0644 root root 3461 44246 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refi18n.html 0644 root root 3886 13776 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refiaddr.html 0644 root root 6422 37591 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refneon.html 0644 root root 12772 5486 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refopts.html 0644 root root 6394 46597 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refreq.html 0644 root root 8741 63651 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refreqbody.html 0644 root root 4429 414 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refreqflags.html 0644 root root 4464 64747 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refreqhdr.html 0644 root root 3847 14833 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refresolve.html 0644 root root 7513 4422 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refresphdr.html 0644 root root 5318 11601 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsess.html 0644 root root 7286 65049 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsessflags.html 0644 root root 5264 321 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refshave.html 0644 root root 2935 61018 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsockinit.html 0644 root root 6809 7650 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsslca.html 0644 root root 4034 31943 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsslcert2.html 0644 root root 3120 14676 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsslcertio.html 0644 root root 5660 44263 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refssldname.html 0644 root root 3923 19162 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsslvfy.html 0644 root root 7289 54873 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refstatus.html 0644 root root 4183 39449 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/reftok.html 0644 root root 4074 32902 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refvers.html 0644 root root 3426 38873 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refxml.html 0644 root root 3090 8982 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/security.html 0644 root root 7105 39440 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/using.html 0644 root root 4878 32156 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/xml.html 0644 root root 11371 14842 1287466446 1 d none /usr/local/share/locale 0755 root root 1 d none /usr/local/share/locale/cs 0755 root root 1 d none /usr/local/share/locale/cs/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/cs/LC_MESSAGES/neon.mo 0644 root root 1566 54425 1287466446 1 d none /usr/local/share/locale/de 0755 root root 1 d none /usr/local/share/locale/de/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/de/LC_MESSAGES/neon.mo 0644 root root 1712 61730 1287466446 1 d none /usr/local/share/locale/fr 0755 root root 1 d none /usr/local/share/locale/fr/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/fr/LC_MESSAGES/neon.mo 0644 root root 387 27923 1287466446 1 d none /usr/local/share/locale/ja 0755 root root 1 d none /usr/local/share/locale/ja/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/ja/LC_MESSAGES/neon.mo 0644 root root 877 10954 1287466446 1 d none /usr/local/share/locale/nn 0755 root root 1 d none /usr/local/share/locale/nn/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/nn/LC_MESSAGES/neon.mo 0644 root root 1626 54775 1287466446 1 d none /usr/local/share/locale/pl 0755 root root 1 d none /usr/local/share/locale/pl/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/pl/LC_MESSAGES/neon.mo 0644 root root 13423 44568 1287466446 1 d none /usr/local/share/locale/ru 0755 root root 1 d none /usr/local/share/locale/ru/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/ru/LC_MESSAGES/neon.mo 0644 root root 383 27737 1287466446 1 d none /usr/local/share/locale/tr 0755 root root 1 d none /usr/local/share/locale/tr/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/tr/LC_MESSAGES/neon.mo 0644 root root 1523 50329 1287466446 1 d none /usr/local/share/locale/zh_CN 0755 root root 1 d none /usr/local/share/locale/zh_CN/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/zh_CN/LC_MESSAGES/neon.mo 0644 root root 8552 58746 1287466446 1 d none /usr/local/share/man 0755 root root 1 d none /usr/local/share/man/man1 0755 root root 1 f none /usr/local/share/man/man1/neon-config.1 0644 root root 3049 47366 1287466446 1 d none /usr/local/share/man/man3 0755 root root 1 f none /usr/local/share/man/man3/ne_add_request_header.3 0644 root root 1833 10031 1287466446 1 f none /usr/local/share/man/man3/ne_addr_destroy.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_addr_error.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_addr_first.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_addr_next.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_addr_resolve.3 0644 root root 4048 4412 1287466446 1 f none /usr/local/share/man/man3/ne_addr_result.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_buffer.3 0644 root root 1914 19451 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_altered.3 0644 root root 27 2379 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_append.3 0644 root root 2583 7817 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_clear.3 0644 root root 1876 14348 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_concat.3 0644 root root 28 2492 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_create.3 0644 root root 1600 54678 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_destroy.3 0644 root root 2083 30703 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_finish.3 0644 root root 29 2638 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_grow.3 0644 root root 27 2379 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_ncreate.3 0644 root root 28 2488 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_zappend.3 0644 root root 28 2492 1287466446 1 f none /usr/local/share/man/man3/ne_calloc.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_close_connection.3 0644 root root 29 2626 1287466446 1 f none /usr/local/share/man/man3/ne_forget_auth.3 0644 root root 30 2750 1287466446 1 f none /usr/local/share/man/man3/ne_get_error.3 0644 root root 2504 2401 1287466446 1 f none /usr/local/share/man/man3/ne_get_request_flag.3 0644 root root 31 2840 1287466446 1 f none /usr/local/share/man/man3/ne_get_response_header.3 0644 root root 2983 46320 1287466446 1 f none /usr/local/share/man/man3/ne_get_scheme.3 0644 root root 28 2532 1287466446 1 f none /usr/local/share/man/man3/ne_get_server_hostport.3 0644 root root 28 2532 1287466446 1 f none /usr/local/share/man/man3/ne_get_session_flag.3 0644 root root 31 2835 1287466446 1 f none /usr/local/share/man/man3/ne_get_status.3 0644 root root 1921 17844 1287466446 1 f none /usr/local/share/man/man3/ne_has_support.3 0644 root root 1909 14106 1287466446 1 f none /usr/local/share/man/man3/ne_i18n_init.3 0644 root root 2351 53915 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_cmp.3 0644 root root 25 2156 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_free.3 0644 root root 25 2156 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_make.3 0644 root root 3410 11349 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_print.3 0644 root root 25 2156 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_typeof.3 0644 root root 25 2156 1287466446 1 f none /usr/local/share/man/man3/ne_malloc.3 0644 root root 2235 43781 1287466446 1 f none /usr/local/share/man/man3/ne_oom_callback.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_print_request_header.3 0644 root root 33 3012 1287466446 1 f none /usr/local/share/man/man3/ne_qtoken.3 0644 root root 20 1676 1287466446 1 f none /usr/local/share/man/man3/ne_realloc.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_request_create.3 0644 root root 4851 19100 1287466446 1 f none /usr/local/share/man/man3/ne_request_destroy.3 0644 root root 29 2631 1287466446 1 f none /usr/local/share/man/man3/ne_request_dispatch.3 0644 root root 29 2631 1287466446 1 f none /usr/local/share/man/man3/ne_response_header_iterate.3 0644 root root 34 3137 1287466446 1 f none /usr/local/share/man/man3/ne_session_create.3 0644 root root 3943 3703 1287466446 1 f none /usr/local/share/man/man3/ne_session_destroy.3 0644 root root 29 2626 1287466446 1 f none /usr/local/share/man/man3/ne_session_proxy.3 0644 root root 29 2626 1287466446 1 f none /usr/local/share/man/man3/ne_set_connect_timeout.3 0644 root root 28 2532 1287466446 1 f none /usr/local/share/man/man3/ne_set_error.3 0644 root root 24 2100 1287466446 1 f none /usr/local/share/man/man3/ne_set_proxy_auth.3 0644 root root 30 2750 1287466446 1 f none /usr/local/share/man/man3/ne_set_read_timeout.3 0644 root root 28 2532 1287466446 1 f none /usr/local/share/man/man3/ne_set_request_body_buffer.3 0644 root root 2302 53550 1287466446 1 f none /usr/local/share/man/man3/ne_set_request_body_fd.3 0644 root root 38 3589 1287466446 1 f none /usr/local/share/man/man3/ne_set_request_body_fd64.3 0644 root root 38 3589 1287466446 1 f none /usr/local/share/man/man3/ne_set_request_flag.3 0644 root root 2240 45461 1287466446 1 f none /usr/local/share/man/man3/ne_set_server_auth.3 0644 root root 3416 14728 1287466446 1 f none /usr/local/share/man/man3/ne_set_session_flag.3 0644 root root 2628 10588 1287466446 1 f none /usr/local/share/man/man3/ne_set_useragent.3 0644 root root 3464 23866 1287466446 1 f none /usr/local/share/man/man3/ne_shave.3 0644 root root 1472 40664 1287466446 1 f none /usr/local/share/man/man3/ne_sock_exit.3 0644 root root 24 2094 1287466446 1 f none /usr/local/share/man/man3/ne_sock_init.3 0644 root root 4202 27286 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_cmp.3 0644 root root 1546 51066 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_export.3 0644 root root 28 2501 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_free.3 0644 root root 27 2409 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_identity.3 0644 root root 3333 14673 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_import.3 0644 root root 28 2501 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_issuer.3 0644 root root 32 2963 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_read.3 0644 root root 2998 52231 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_signedby.3 0644 root root 32 2963 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_subject.3 0644 root root 32 2963 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_write.3 0644 root root 28 2501 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_decrypt.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_encrypted.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_free.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_name.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_owner.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_read.3 0644 root root 4660 4117 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_dname_cmp.3 0644 root root 33 2992 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_readable_dname.3 0644 root root 1872 13146 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_set_verify.3 0644 root root 4499 42551 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_trust_cert.3 0644 root root 2164 39497 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_trust_default_ca.3 0644 root root 29 2667 1287466446 1 f none /usr/local/share/man/man3/ne_status.3 0644 root root 2073 28593 1287466446 1 f none /usr/local/share/man/man3/ne_strdup.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_strndup.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_token.3 0644 root root 2190 39337 1287466446 1 f none /usr/local/share/man/man3/ne_version_match.3 0644 root root 1821 7016 1287466446 1 f none /usr/local/share/man/man3/ne_version_string.3 0644 root root 28 2525 1287466446 1 f none /usr/local/share/man/man3/ne_xml_create.3 0644 root root 1446 40548 1287466446 1 f none /usr/local/share/man/man3/ne_xml_destroy.3 0644 root root 25 2191 1287466446 1 f none /usr/local/share/man/man3/neon.3 0644 root root 8421 7896 1287466446 1 i checkinstall 790 2504 1287466459 1 i pkginfo 269 20401 1287466461 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!! 0707010005ff92000081a40000000000000000000000014cbd2ddd0000010d000000b500010002ffffffffffffffff0000000800000000pkginfo PKG=neon NAME=neon 0.29.4 i86pc Solaris 10 VERSION=0.29.4 PSTAMP=11th October 2010 VENDOR=The WebDAV Project EMAIL=http://www.webdav.org/neon DESC=neon HTTP and WebDAV client library ARCH=i386 CATEGORY=utility CLASSES=none BASEDIR=/ ISTATES=S s 1 2 3 RSTATES=S s 1 2 3 0707010005ff91000081a40000000000000000000000014cbd2dde0000454a000000b500010002ffffffffffffffff0000000700000000pkgmap : 1 4506 1 d none /usr ? ? ? 1 d none /usr/local ? ? ? 1 d none /usr/local/bin 0755 root root 1 f none /usr/local/bin/neon-config 0755 root root 2050 27326 1287466446 1 d none /usr/local/include 0755 root root 1 d none /usr/local/include/neon 0755 root root 1 f none /usr/local/include/neon/ne_207.h 0644 root root 4418 36713 1287466445 1 f none /usr/local/include/neon/ne_acl.h 0644 root root 1455 52952 1287466445 1 f none /usr/local/include/neon/ne_acl3744.h 0644 root root 2735 19094 1287466445 1 f none /usr/local/include/neon/ne_alloc.h 0644 root root 1880 28884 1287466445 1 f none /usr/local/include/neon/ne_auth.h 0644 root root 5617 25875 1287466445 1 f none /usr/local/include/neon/ne_basic.h 0644 root root 6148 45315 1287466445 1 f none /usr/local/include/neon/ne_compress.h 0644 root root 1746 18274 1287466445 1 f none /usr/local/include/neon/ne_dates.h 0644 root root 1646 4791 1287466445 1 f none /usr/local/include/neon/ne_defs.h 0644 root root 1944 29898 1287466445 1 f none /usr/local/include/neon/ne_i18n.h 0644 root root 2008 39818 1287466445 1 f none /usr/local/include/neon/ne_locks.h 0644 root root 6325 20559 1287466445 1 f none /usr/local/include/neon/ne_md5.h 0644 root root 3920 4880 1287466445 1 f none /usr/local/include/neon/ne_pkcs11.h 0644 root root 4812 54700 1287466445 1 f none /usr/local/include/neon/ne_props.h 0644 root root 10005 20040 1287466445 1 f none /usr/local/include/neon/ne_redirect.h 0644 root root 1515 62708 1287466445 1 f none /usr/local/include/neon/ne_request.h 0644 root root 14411 53392 1287466445 1 f none /usr/local/include/neon/ne_session.h 0644 root root 14933 25826 1287466445 1 f none /usr/local/include/neon/ne_socket.h 0644 root root 12132 54375 1287466445 1 f none /usr/local/include/neon/ne_ssl.h 0644 root root 8175 54546 1287466445 1 f none /usr/local/include/neon/ne_string.h 0644 root root 7484 41940 1287466445 1 f none /usr/local/include/neon/ne_uri.h 0644 root root 3905 4249 1287466445 1 f none /usr/local/include/neon/ne_utils.h 0644 root root 4102 8013 1287466445 1 f none /usr/local/include/neon/ne_xml.h 0644 root root 6806 49304 1287466445 1 f none /usr/local/include/neon/ne_xmlreq.h 0644 root root 1973 36605 1287466445 1 d none /usr/local/lib 0755 root root 1 f none /usr/local/lib/libneon.a 0644 root root 626908 60308 1287466445 1 f none /usr/local/lib/libneon.la 0755 root root 1132 34195 1287466445 1 s none /usr/local/lib/libneon.so=libneon.so.27.2.4 1 s none /usr/local/lib/libneon.so.27=libneon.so.27.2.4 1 f none /usr/local/lib/libneon.so.27.2.4 0755 root root 547704 48506 1287466445 1 d none /usr/local/lib/pkgconfig 0755 root root 1 f none /usr/local/lib/pkgconfig/neon.pc 0644 root root 487 42795 1287466446 1 d none /usr/local/share 0755 root root 1 d none /usr/local/share/doc 0755 root root 1 d none /usr/local/share/doc/neon-0.29.4 0755 root root 1 d none /usr/local/share/doc/neon-0.29.4/html 0755 root root 1 f none /usr/local/share/doc/neon-0.29.4/html/api.html 0644 root root 2553 26430 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/biblio.html 0644 root root 5015 45393 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/compliance.html 0644 root root 5427 13907 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/features.html 0644 root root 4698 31608 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/index.html 0644 root root 10881 175 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/intro.html 0644 root root 3547 49000 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/ref.html 0644 root root 7416 27825 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refalloc.html 0644 root root 4989 50967 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refauth.html 0644 root root 6019 12157 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbuf.html 0644 root root 3586 56699 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbufapp.html 0644 root root 5135 62023 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbufcr.html 0644 root root 3371 35735 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbufdest.html 0644 root root 4096 34899 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refbufutil.html 0644 root root 3956 24820 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refcert.html 0644 root root 5991 9324 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refclicert.html 0644 root root 8023 57774 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refconfig.html 0644 root root 5207 62800 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/referr.html 0644 root root 4408 62321 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/reffeat.html 0644 root root 4134 34780 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refgetst.html 0644 root root 3461 44246 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refi18n.html 0644 root root 3886 13776 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refiaddr.html 0644 root root 6422 37591 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refneon.html 0644 root root 12772 5486 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refopts.html 0644 root root 6394 46597 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refreq.html 0644 root root 8741 63651 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refreqbody.html 0644 root root 4429 414 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refreqflags.html 0644 root root 4464 64747 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refreqhdr.html 0644 root root 3847 14833 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refresolve.html 0644 root root 7513 4422 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refresphdr.html 0644 root root 5318 11601 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsess.html 0644 root root 7286 65049 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsessflags.html 0644 root root 5264 321 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refshave.html 0644 root root 2935 61018 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsockinit.html 0644 root root 6809 7650 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsslca.html 0644 root root 4034 31943 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsslcert2.html 0644 root root 3120 14676 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsslcertio.html 0644 root root 5660 44263 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refssldname.html 0644 root root 3923 19162 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refsslvfy.html 0644 root root 7289 54873 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refstatus.html 0644 root root 4183 39449 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/reftok.html 0644 root root 4074 32902 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refvers.html 0644 root root 3426 38873 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/refxml.html 0644 root root 3090 8982 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/security.html 0644 root root 7105 39440 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/using.html 0644 root root 4878 32156 1287466446 1 f none /usr/local/share/doc/neon-0.29.4/html/xml.html 0644 root root 11371 14842 1287466446 1 d none /usr/local/share/locale 0755 root root 1 d none /usr/local/share/locale/cs 0755 root root 1 d none /usr/local/share/locale/cs/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/cs/LC_MESSAGES/neon.mo 0644 root root 1566 54425 1287466446 1 d none /usr/local/share/locale/de 0755 root root 1 d none /usr/local/share/locale/de/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/de/LC_MESSAGES/neon.mo 0644 root root 1712 61730 1287466446 1 d none /usr/local/share/locale/fr 0755 root root 1 d none /usr/local/share/locale/fr/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/fr/LC_MESSAGES/neon.mo 0644 root root 387 27923 1287466446 1 d none /usr/local/share/locale/ja 0755 root root 1 d none /usr/local/share/locale/ja/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/ja/LC_MESSAGES/neon.mo 0644 root root 877 10954 1287466446 1 d none /usr/local/share/locale/nn 0755 root root 1 d none /usr/local/share/locale/nn/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/nn/LC_MESSAGES/neon.mo 0644 root root 1626 54775 1287466446 1 d none /usr/local/share/locale/pl 0755 root root 1 d none /usr/local/share/locale/pl/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/pl/LC_MESSAGES/neon.mo 0644 root root 13423 44568 1287466446 1 d none /usr/local/share/locale/ru 0755 root root 1 d none /usr/local/share/locale/ru/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/ru/LC_MESSAGES/neon.mo 0644 root root 383 27737 1287466446 1 d none /usr/local/share/locale/tr 0755 root root 1 d none /usr/local/share/locale/tr/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/tr/LC_MESSAGES/neon.mo 0644 root root 1523 50329 1287466446 1 d none /usr/local/share/locale/zh_CN 0755 root root 1 d none /usr/local/share/locale/zh_CN/LC_MESSAGES 0755 root root 1 f none /usr/local/share/locale/zh_CN/LC_MESSAGES/neon.mo 0644 root root 8552 58746 1287466446 1 d none /usr/local/share/man 0755 root root 1 d none /usr/local/share/man/man1 0755 root root 1 f none /usr/local/share/man/man1/neon-config.1 0644 root root 3049 47366 1287466446 1 d none /usr/local/share/man/man3 0755 root root 1 f none /usr/local/share/man/man3/ne_add_request_header.3 0644 root root 1833 10031 1287466446 1 f none /usr/local/share/man/man3/ne_addr_destroy.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_addr_error.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_addr_first.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_addr_next.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_addr_resolve.3 0644 root root 4048 4412 1287466446 1 f none /usr/local/share/man/man3/ne_addr_result.3 0644 root root 27 2405 1287466446 1 f none /usr/local/share/man/man3/ne_buffer.3 0644 root root 1914 19451 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_altered.3 0644 root root 27 2379 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_append.3 0644 root root 2583 7817 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_clear.3 0644 root root 1876 14348 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_concat.3 0644 root root 28 2492 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_create.3 0644 root root 1600 54678 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_destroy.3 0644 root root 2083 30703 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_finish.3 0644 root root 29 2638 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_grow.3 0644 root root 27 2379 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_ncreate.3 0644 root root 28 2488 1287466446 1 f none /usr/local/share/man/man3/ne_buffer_zappend.3 0644 root root 28 2492 1287466446 1 f none /usr/local/share/man/man3/ne_calloc.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_close_connection.3 0644 root root 29 2626 1287466446 1 f none /usr/local/share/man/man3/ne_forget_auth.3 0644 root root 30 2750 1287466446 1 f none /usr/local/share/man/man3/ne_get_error.3 0644 root root 2504 2401 1287466446 1 f none /usr/local/share/man/man3/ne_get_request_flag.3 0644 root root 31 2840 1287466446 1 f none /usr/local/share/man/man3/ne_get_response_header.3 0644 root root 2983 46320 1287466446 1 f none /usr/local/share/man/man3/ne_get_scheme.3 0644 root root 28 2532 1287466446 1 f none /usr/local/share/man/man3/ne_get_server_hostport.3 0644 root root 28 2532 1287466446 1 f none /usr/local/share/man/man3/ne_get_session_flag.3 0644 root root 31 2835 1287466446 1 f none /usr/local/share/man/man3/ne_get_status.3 0644 root root 1921 17844 1287466446 1 f none /usr/local/share/man/man3/ne_has_support.3 0644 root root 1909 14106 1287466446 1 f none /usr/local/share/man/man3/ne_i18n_init.3 0644 root root 2351 53915 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_cmp.3 0644 root root 25 2156 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_free.3 0644 root root 25 2156 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_make.3 0644 root root 3410 11349 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_print.3 0644 root root 25 2156 1287466446 1 f none /usr/local/share/man/man3/ne_iaddr_typeof.3 0644 root root 25 2156 1287466446 1 f none /usr/local/share/man/man3/ne_malloc.3 0644 root root 2235 43781 1287466446 1 f none /usr/local/share/man/man3/ne_oom_callback.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_print_request_header.3 0644 root root 33 3012 1287466446 1 f none /usr/local/share/man/man3/ne_qtoken.3 0644 root root 20 1676 1287466446 1 f none /usr/local/share/man/man3/ne_realloc.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_request_create.3 0644 root root 4851 19100 1287466446 1 f none /usr/local/share/man/man3/ne_request_destroy.3 0644 root root 29 2631 1287466446 1 f none /usr/local/share/man/man3/ne_request_dispatch.3 0644 root root 29 2631 1287466446 1 f none /usr/local/share/man/man3/ne_response_header_iterate.3 0644 root root 34 3137 1287466446 1 f none /usr/local/share/man/man3/ne_session_create.3 0644 root root 3943 3703 1287466446 1 f none /usr/local/share/man/man3/ne_session_destroy.3 0644 root root 29 2626 1287466446 1 f none /usr/local/share/man/man3/ne_session_proxy.3 0644 root root 29 2626 1287466446 1 f none /usr/local/share/man/man3/ne_set_connect_timeout.3 0644 root root 28 2532 1287466446 1 f none /usr/local/share/man/man3/ne_set_error.3 0644 root root 24 2100 1287466446 1 f none /usr/local/share/man/man3/ne_set_proxy_auth.3 0644 root root 30 2750 1287466446 1 f none /usr/local/share/man/man3/ne_set_read_timeout.3 0644 root root 28 2532 1287466446 1 f none /usr/local/share/man/man3/ne_set_request_body_buffer.3 0644 root root 2302 53550 1287466446 1 f none /usr/local/share/man/man3/ne_set_request_body_fd.3 0644 root root 38 3589 1287466446 1 f none /usr/local/share/man/man3/ne_set_request_body_fd64.3 0644 root root 38 3589 1287466446 1 f none /usr/local/share/man/man3/ne_set_request_flag.3 0644 root root 2240 45461 1287466446 1 f none /usr/local/share/man/man3/ne_set_server_auth.3 0644 root root 3416 14728 1287466446 1 f none /usr/local/share/man/man3/ne_set_session_flag.3 0644 root root 2628 10588 1287466446 1 f none /usr/local/share/man/man3/ne_set_useragent.3 0644 root root 3464 23866 1287466446 1 f none /usr/local/share/man/man3/ne_shave.3 0644 root root 1472 40664 1287466446 1 f none /usr/local/share/man/man3/ne_sock_exit.3 0644 root root 24 2094 1287466446 1 f none /usr/local/share/man/man3/ne_sock_init.3 0644 root root 4202 27286 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_cmp.3 0644 root root 1546 51066 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_export.3 0644 root root 28 2501 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_free.3 0644 root root 27 2409 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_identity.3 0644 root root 3333 14673 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_import.3 0644 root root 28 2501 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_issuer.3 0644 root root 32 2963 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_read.3 0644 root root 2998 52231 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_signedby.3 0644 root root 32 2963 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_subject.3 0644 root root 32 2963 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_cert_write.3 0644 root root 28 2501 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_decrypt.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_encrypted.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_free.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_name.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_owner.3 0644 root root 31 2813 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_clicert_read.3 0644 root root 4660 4117 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_dname_cmp.3 0644 root root 33 2992 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_readable_dname.3 0644 root root 1872 13146 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_set_verify.3 0644 root root 4499 42551 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_trust_cert.3 0644 root root 2164 39497 1287466446 1 f none /usr/local/share/man/man3/ne_ssl_trust_default_ca.3 0644 root root 29 2667 1287466446 1 f none /usr/local/share/man/man3/ne_status.3 0644 root root 2073 28593 1287466446 1 f none /usr/local/share/man/man3/ne_strdup.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_strndup.3 0644 root root 21 1763 1287466446 1 f none /usr/local/share/man/man3/ne_token.3 0644 root root 2190 39337 1287466446 1 f none /usr/local/share/man/man3/ne_version_match.3 0644 root root 1821 7016 1287466446 1 f none /usr/local/share/man/man3/ne_version_string.3 0644 root root 28 2525 1287466446 1 f none /usr/local/share/man/man3/ne_xml_create.3 0644 root root 1446 40548 1287466446 1 f none /usr/local/share/man/man3/ne_xml_destroy.3 0644 root root 25 2191 1287466446 1 f none /usr/local/share/man/man3/neon.3 0644 root root 8421 7896 1287466446 1 i checkinstall 790 2504 1287466459 1 i pkginfo 269 20401 1287466461 0707010005f065000041ed0000000000000000000000024cbd2dde00000000000000b500010002ffffffffffffffff0000000800000000install 0707010005f066000081ed0000000000000000000000014cbd2ddb00000316000000b500010002ffffffffffffffff0000001500000000install/checkinstall #!/bin/sh # expected_bits="64" expected_release="5.10" expected_platform="i386" # release=`uname -r` platform=`uname -p` bits=`isainfo -b` # if [ ${platform} != ${expected_platform} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n" echo "\tAborting installation.\n\n\n" exit 1 fi if [ ${release} != ${expected_release} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n" echo "\tAborting installation.\n\n\n" exit 1 fi #if [ ${bits} != ${expected_bits} ]; then # echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n" # echo "\tYour machine is running a ${bits} bit O.S. currently\n" # echo "\tAborting installation.\n\n\n" # exit 1 #fi exit 0 0707010005ff93000041ed0000000000000000000000034cbd2dde00000000000000b500010002ffffffffffffffff0000000500000000root 0707010005ff94000041ed0000000000000000000000034cbd2dde00000000000000b500010002ffffffffffffffff0000000900000000root/usr 0707010005ff95000041ed0000000000000000000000064cbd2dde00000000000000b500010002ffffffffffffffff0000000f00000000root/usr/local 0707010005ffb8000041ed0000000000000000000000054cbd2dde00000000000000b500010002ffffffffffffffff0000001500000000root/usr/local/share 0707010005ffb9000041ed0000000000000000000000034cbd2dde00000000000000b500010002ffffffffffffffff0000001900000000root/usr/local/share/doc 0707010005ffba000041ed0000000000000000000000034cbd2dde00000000000000b500010002ffffffffffffffff0000002500000000root/usr/local/share/doc/neon-0.29.4 0707010005ffbb000041ed0000000000000000000000024cbd2dde00000000000000b500010002ffffffffffffffff0000002a00000000root/usr/local/share/doc/neon-0.29.4/html 0707010005ffc9000081a40000000000000000000000014cbd2dce00000f74000000b500010002ffffffffffffffff0000003a00000000root/usr/local/share/doc/neon-0.29.4/html/refbufutil.html
ne_buffer_clear, ne_buffer_grow, ne_buffer_altered — clear, grow, or mark as altered a string buffer
#include <ne_string.h>
void ne_buffer_clear( | ne_buffer *buf) ; |
void ne_buffer_altered( | ne_buffer *buf) ; |
void ne_buffer_grow( | ne_buffer *buf, |
size_t size) ; |
The ne_buffer_clear
function sets
the string stored in buf
to be the empty string
(""
).
The ne_buffer_altered
function must
be used after the string stored in the buffer
buf
is modified by directly rather than using
ne_buffer_append, ne_buffer_zappend
or ne_buffer_concat.
The ne_buffer_grow
function
ensures that at least size
bytes are allocated
for the string; this can be used if a large amount of data is going to
be appended to the buffer and may result in more efficient memory
allocation.
Table of Contents
neon — HTTP and WebDAV client library
neon is an HTTP and WebDAV client library. The major abstractions exposed are the HTTP session, created by ne_session_create; and the HTTP request, created by ne_request_create. HTTP authentication is handled transparently for server and proxy servers, see ne_set_server_auth; complete SSL/TLS support is also included, see ne_ssl_set_verify.
Some conventions are used throughout the neon API, to provide a consistent and simple interface; these are documented below.
neon itself is implemented to be thread-safe (avoiding any
use of global state), but relies on the operating system providing
a thread-safe resolver interface. Modern operating systems offer
the thread-safe getaddrinfo
interface, which
neon supports; some others implement
gethostbyname
using thread-local
storage.
To allow thread-safe use of SSL in the OpenSSL and GnuTLS
libraries neon must be configured using the
--enable-threadsafe-ssl
; if this is done,
locking callbacks will be registered by ne_sock_init; note that care must be exercised if
neon is used in conjunction with another library which uses
OpenSSL or GnuTLS.
Some platforms and libraries used by neon require global initialization before use; notably:
SIGPIPE
signal
disposition must be set to ignored or
otherwise handled to avoid process termination when writing to a
socket which has been shutdown by the peer.The ne_sock_init function should be called before any other use of neon to perform any necessary initialization needed for the particular platform. Applications wishing to perform all the necessary process-global initialization steps themselves may omit to call ne_sock_init (and ne_sock_exit); neon neither checks whether these functions are called nor calls them itself.
For some applications and configurations it may be necessary to call ne_i18n_init to initialize the support for internationalization in neon.
No function in neon is defined to be “async-signal safe” - that is, no function is safe to call from a signal handler. Any call into the neon library from a signal handler will have undefined behaviour - in other words, it may crash the process.
Any function in neon may modify the
errno
global variable as a side-effect. Except
where explicitly documented, the value of errno
is unspecified after any neon function call.
Other than in the use of errno
, the only
functions which use or modify process-global state in neon are
as follows:
ne_debug_init
and
ne_debug
, if enabled at compile time; for
debugging outputmalloc
failureTo avoid possible collisions between names used for symbols and preprocessor macros by an application and the libraries it uses, it is good practice for each library to reserve a particular namespace prefix. An application which ensures it uses no names with these prefixes is then guaranteed to avoid such collisions.
The neon library reserves the use of the namespace
prefixes ne_
and NE_
. The
libraries used by neon may also reserve certain namespaces;
collisions between these libraries and a neon-based application
will not be detected at compile time, since the underlying library
interfaces are not exposed through the neon header files. Such
collisions can only be detected at link time, when the linker
attempts to resolve symbols. The following list documents some of
the namespaces claimed by libraries used by neon; this list may
be incomplete.
SSL, ssl, TLS, tls, ERR_, BIO_, d2i_, i2d_, ASN1_ | Some of the many prefixes used by the OpenSSL library; little attempt has been made to keep exported symbols within any particular prefixes for this library. |
gnutls_, gcry_, gpg_ | Namespaces used by the GnuTLS library (and dependencies thereof) |
XML_, Xml[A-Z] | Namespaces used by the expat library. |
xml[A-Z], html[A-Z], docb[A-Z] | Namespaces used by the libxml2 library; a relatively small number of symbols are used without these prefixes. |
inflate, deflate, crc32, compress, uncompres, adler32, zlib | Namespaces used by the zlib library; a relatively small number of symbols are used without these prefixes. |
krb5, gss, GSS, asn1, decode_krb5, encode_krb5, profile, mit | Some of the prefixes used by the MIT GSSAPI library and dependencies thereof; a number of symbols lie outside these prefixes. |
pakchois_ | Namespace used by the pakchois library. |
px_ | Namespace used by the libproxy library. |
neon does not attempt to validate that the parameters
passed to functions conform to the API (for instance, checking
that pointer arguments are not NULL
). Any use of the neon API
which is not documented to produce a certain behaviour results is
said to produce undefined behaviour; it is
likely that neon will segfault under these conditions.
The path strings passed to any function must be URI-encoded by the application; neon never performs any URI encoding or decoding internally. WebDAV property names and values must be valid UTF-8 encoded Unicode strings.
As a pure library interface, neon will never produce
output on stdout
or
stderr
; all user interaction is the
responsibilty of the application.
neon does not attempt to cope gracefully with an
out-of-memory situation; instead, by default, the
abort
function is called to immediately
terminate the process. An application may register a custom
function which will be called before abort
in
such a situation; see ne_oom_callback.
Whenever a callback is registered, a
userdata
pointer is also used to allow the
application to associate a context with the callback. The
userdata is of type void *, allowing any pointer to
be used.
Since version 0.27.0, neon transparently uses the "LFS
transitional" interfaces in places where file-backed file
descriptors are manipulated. This means files larger than 2GiB
can be handled on platforms with a native 32-bit
off_t
type, where LFS support is
available.
Some interfaces use the ne_off_t
type,
which is defined to be either off_t
or
off64_t
according to whether LFS support is
detected at build time. neon does not use or require the
-D_FILE_OFFSET_BITS=64
macro definition.
ne_ssl_trust_cert, ne_ssl_trust_default_ca — functions to indicate that certificates are trusted
#include <ne_session.h>
void ne_ssl_trust_cert( | ne_session *session, |
const ne_ssl_certificate *cert) ; |
void ne_ssl_trust_default_ca( | ne_session *session) ; |
To indicate that a given certificate is trusted by the
user, the certificate object can be passed to
ne_ssl_trust_cert
. The certificate object is
duplicated internally and can subsequently be destroyed.
The SSL library in use by neon may include a default
set of CA certificates; calling the
ne_ssl_trust_default_ca
function will indicate
that these CAs are trusted by the user.
Load the CA certificate stored in /path/to/cacert.pem
:
ne_session *sess = ne_session_create(...); ne_ssl_certificate *cert = ne_ssl_cert_read("/path/to/cacert.pem"); if (cert) { ne_ssl_trust_cert(sess, cert); ne_ssl_cert_free(cert); } else { printf("Could not load CA cert: %s\n", ne_get_error(sess)); }
[SSL-and-TLS] SSL and TLS: Designing and Building Secure Systems. 0-201-62598-3. Addison-Wesley. March 2001.
[REC-XML-names] Namespaces in XML. January 1999.
[RFC2616] Hypertext Transfer Protocol—HTTP/1.1. IETF. June 1999.
[RFC2518] HTTP Extensions for Distributed Authoring—WEBDAV. IETF. February 1999.
[RFC3280] Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile. IETF. April 2002.
ne_set_useragent, ne_set_read_timeout, ne_set_connect_timeout, ne_get_scheme, ne_get_server_hostport — common properties for HTTP sessions
#include <ne_session.h>
void ne_set_useragent( | ne_session *session, |
const char *product) ; |
void ne_set_read_timeout( | ne_session *session, |
int timeout) ; |
void ne_set_connect_timeout( | ne_session *session, |
int timeout) ; |
const char *ne_get_scheme( | ne_sesssion *session) ; |
const char *ne_get_server_hostport( | ne_sesssion *session) ; |
The User-Agent
request header is used
to identify the software which generated the request for statistical
or debugging purposes. neon does not send a
User-Agent
header unless a call is made to the
ne_set_useragent
.
ne_set_useragent
must be passed a product string
conforming to RFC2616's product token grammar; of the form
"Product/Version"
.
When neon reads from a socket, by default the read
operation will time out after 60 seconds, and the request will fail
giving an NE_TIMEOUT error. To configure this
timeout interval, call ne_set_read_timeout
giving
the desired number of seconds as the timeout
parameter.
When a connection is being established to a server,
normally only the system's TCP timeout handling will apply.
To configure a specific (and probably shorter) timeout, the
ne_set_connect_timeout
can be used,
giving the desired number of seconds as the
timeout
parameter. If
0
is passed, then the default behaviour of
using the system TCP timeout will be used.
The scheme used to initially create the session will be
returned by ne_get_scheme
.
The hostport pair with which the session is associated
will be returned by the
ne_get_server_hostport
; for example
www.example.com:8080
. Note that the
:port
will be omitted if the default port
for the scheme is used.
ne_buffer_destroy, ne_buffer_finish — destroy a buffer object
#include <ne_string.h>
void ne_buffer_destroy( | ne_buffer *buf) ; |
char *ne_buffer_finish( | ne_buffer *buf) ; |
ne_buffer_destroy
frees all memory
associated with the buffer. ne_buffer_finish
frees the buffer structure, but not the actual string stored in the
buffer, which is returned and must be free
()d by
the caller.
Any use of the buffer object after calling either of these functions gives undefined behaviour.
ne_get_response_header, ne_response_header_iterate — functions to access response headers
#include <ne_request.h>
const char *ne_get_response_header( | ne_request *request, |
const char *name) ; |
void *ne_response_header_iterate( | ne_request *request, |
void *cursor, | |
const char **name, | |
const char **value) ; |
To retrieve the value of a response header field, the
ne_get_response_header
function can be used,
and is given the name of the header to return.
To iterate over all the response headers returned, the
ne_response_header_iterate
function can be
used. This function takes a cursor
parameter which should be NULL
to retrieve the first header. The
function stores the name and value of the next header header in
the name
and value
parameters, and returns a new cursor pointer which can be passed
to ne_response_header_iterate
to retrieve the
next header.
ne_get_response_header
returns a
string, or NULL
if no header with that name was given. If used
during request processing, the return value pointer is valid only
until the next call to ne_begin_request
, or
else, until the request object is destroyed.
Likewise, the cursor, names, and values returned by
ne_response_header_iterate
are only valid
until the next call to ne_begin_request
or
until the request object is destroyed.
The following code will output the value of the
Last-Modified
header for a resource:
ne_request *req = ne_request_create(sess, "GET", "/foo.txt"); if (ne_request_dispatch(req) == NE_OK) { const char *mtime = ne_get_response_header(req, "Last-Modified"); if (mtime) { printf("/foo.txt has last-modified value %s\n", mtime); } } ne_request_destroy(req);
ne_add_request_header, ne_print_request_header — add headers to a request
#include <ne_request.h>
void ne_add_request_header( | ne_request *request, |
const char *name, | |
const char *value) ; |
void ne_print_request_header( | ne_request *request, |
const char *name, | |
const char *format, | |
...) ; |
The functions ne_add_request_header
and ne_print_request_header
can be used to add
headers to a request, before it is sent.
ne_add_request_header
simply adds a
header of given name
, with given
value
.
ne_print_request_header
adds a
header of given name
, taking the value from the
printf
-like format
string
parameter and subsequent variable-length argument list.
Copyright © 2001-2008 Joe Orton
This document is free documentation; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This document is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Table of Contents
List of Examples
neon is intended to be secure against a specific threat model: use of a malicious HTTP server. Under this threat model, a range of attacks are possible against a client when the user (or application) can be tricked into accessing an HTTP server which is controlled by an attacker. This section documents various types of possible attack and describes what mitigation is used in neon.
neon uses fixed resource limits to prevent the following attacks:
memory/CPU consumption attack using an unbounded number of response header fields
memory consumption attack using an unbounded length of individual response header lines (or continuation headers)
memory consumption attack against the PROPFIND code using an unbounded number of properties (propstat elements) per resource
memory consumption attack against the PROPFIND code using an unbounded CDATA element in a "flat property" value
Memory consumption attacks against applications based on neon by use of unbounded response length are also possible, but must be mitigated at application level. Memory consumption in neon itself is fixed and is not proportional to the response size.
Test cases for all the above attacks are present in the neon test suite.
When using a connection secured by SSL/TLS, it is necessary for clients to verify that the X.509 certificate presented by the server matches the server's expected identity. The algorithm required for this purpose is described in RFC 2818 and RFC 3280, and is implemented by neon in the following manner:
the hostname argument passed to ne_session_create is the expected identity of the server
the subjectAltName extension of the certificate is used for comparision against the expected identity, in preference to the Subject name's commonName attribute.
the dNSName, iPAddress, and uniformResourceIdentifier classes of GeneralName are supported in subjectAltName comparison.
if no subjectAltName is present in the certificate, the most specific commonName attribute in the Subject name is used for comparison instead.
In the case where a server certificate is presented that does not match the expected identity (or is otherwise not trusted), neon will fail the request by default. This behaviour can be overridden by the use of a callback installed using ne_ssl_set_verify, which allows the application to present the certificate details to a user for manual/off-line verification, if possible.
Test cases for the correctness of the implementation of the identity verification algorithm are present in the neon test suite.
Where error messages (as returned by (ne_get_error) contain data supplied by the server, the untrusted data is sanitised to remove both control characters and non-ASCII characters. This prevents any attacks where such error messages are exposed to the user and can potentially distort the presentation of the interface (for example, through the use of a carriage return character in a text user interface).
Authentication credentials can be compromised by a "downgrade attack" by an active attacker; for example, where a MITM presents a Basic authentication challenge in place of the server's Digest challenge. neon mitigates these attacks by allowing the application (and hence, user) to specify that only a specific set of authentication protocols is permitted.
neon supports the Digest and Negotiate authentication schemes, which both allow authentication of users without passing credentials in cleartext over the wire. The "domain" parameter is supported in Digest, allowing the server to restrict an authentication session to a particular set of URIs.
ne_ssl_readable_dname, ne_ssl_dname_cmp — SSL distinguished name handling
#include <ne_ssl.h>
const char *ne_ssl_readable_dname( | const ne_ssl_dname *dname) ; |
int ne_ssl_dname_cmp( | const ne_ssl_dname *dn1, |
const ne_ssl_dname *dn2) ; |
The ne_ssl_readable_dname
function
creates a single-line, human-readable string out of an
ne_ssl_dname object. The returned string is
malloc
()-allocated, and must be
free
()d by the caller.
The ne_ssl_dname_cmp
function
compares two distinguished names, and returns zero if they are
equal, or non-zero otherwise.
ne_set_request_body_buffer, ne_set_request_body_fd, ne_set_request_body_fd64 — include a message body with a request
#include <ne_request.h>
void ne_set_request_body_buffer( | ne_request *req, |
const char *buf, | |
size_t count) ; |
int ne_set_request_body_fd( | ne_request *req, |
int fd, | |
off_t begin, | |
off_t length) ; |
The ne_set_request_body_buffer
function specifies that a message body should be included with the
body, which is stored in the count
bytes buffer
buf
.
The ne_set_request_body_fd
function
can be used to include a message body with a request which is read
from a file descriptor. The body is read from the file descriptor
fd
, which must be a associated with a seekable
file (not a pipe, socket, or FIFO). count
bytes are read, beginning at offset begin
(hence, passing begin
as zero means the body is read
from the beginning of the file).
For all the above functions, the source of the request
body must survive until the request has been dispatched;
neither the memory buffer passed to
ne_set_request_body_buffer
nor the file
descriptor passed to
ne_set_request_body_fd
are copied
internally.
ne_set_request_flag, ne_get_request_flag — set and retrieve per-request flags
#include <ne_request.h>
void ne_set_request_flag( | ne_request *req, |
ne_request_flag flag, | |
int value) ; |
int ne_get_request_flag( | ne_request *req, |
ne_request_flag flag) ; |
The ne_set_request_flag
function
enables or disables a per-request flag. Passing a non-zero
value
argument enables the flag, and zero
disables it.
The following flags are defined:
| enable this flag to use the "Expect: 100-continue" feature of HTTP/1.1, which allows the server to process request headers without reading the entire request body. This saves time and bandwidth if the server gives an authentication challenge (requiring the request to be resent), but has interoperability problems with some older servers. |
| disable this flag if the request uses a
non-idempotent method such as
POST |
ne_get_error, ne_set_error — error handling for HTTP sessions
#include <ne_session.h>
const char *ne_get_error( | ne_sesssion *session) ; |
void ne_set_error( | ne_sesssion *session, |
const char *format, | |
...) ; |
The session error string is used to store any human-readable error information associated with any errors which occur whilst using the HTTP session.
The ne_get_error
function returns
the current session error string. This string persists only
until it is changed by a subsequent operation on the session.
If localisation was enabled at build time, and if necessary
enabled at run-time if necessary using ne_i18n_init, the returned string may have been
translated into the user's current locale.
The ne_set_error
function can be
used to set a new session error string, using a
printf
-style format string
interface.
The major features of the neon library are as follows:
A high-level interface to common HTTP and WebDAV methods. This allows you to easily dispatch a GET or a MKCOL request against a resource with a single function call.
A low-level interface for HTTP request handling; allowing you to implement requests using arbitrary methods and request headers, capture arbitrary response headers, and so on.
Persistent connection support; neon groups a set of requests to a server into a "session"; requests within that session can use a persistent (also known as "keep-alive") connection.
Modern HTTP authentication support: a complete implementation of the new authentication standard, RFC2617, supporting the Digest, Basic, and Negotiate protocols. Credentials are supplied by an application-defined callback as appropriate.
Proxy server support; a session can be set to use a proxy server. Authentication is supported for the Proxy as well as the origin server. The system's proxy configuration can be optionally used, on some platforms.
Complete SSL support; a simple interface for enabling SSL, hiding the complexity of using an SSL library directly. Client certificate support, callback-based server certificate verification, along with functions to load trusted CA certificates. Smartcard-based client certs are also supported via a wrapper interface for PKCS#11 modules.
Compressed response support: responses compressed using the "deflate" algorithm can be transparently decompressed.
Generic XML parsing interface for handling XML response bodies using SAX-like callbacks. Both the expat and libxml XML parser libraries are supported.
WebDAV metadata support; set and remove properties, query properties (PROPFIND); simple interface for retrieving "flat" byte-string properties, more advanced support for parsing "complex" structured XML properties.
Build environment support: the neon source tree is designed so that it can be embedded in your application's build tree; autoconf macros are supplied for integration. To get started quickly a neon-config script is included, to easily determine how to compile and link against an installed copy of neon
Complete test suite: the neon test suite comprises half as many lines of source code as the library itself, including many tests for protocol compliance in network behaviour, and that the library implementation meets the guarantees made by the API.
ne_ssl_cert_identity, ne_ssl_cert_signedby, ne_ssl_cert_issuer, ne_ssl_cert_subject — functions to access certificate properties
#include <ne_ssl.h>
const char *ne_ssl_cert_identity( | const ne_ssl_certificate *cert) ; |
const ne_ssl_certificate *ne_ssl_cert_signedby( | const ne_ssl_certificate *cert) ; |
const ne_ssl_dname *ne_ssl_cert_subject( | const ne_ssl_certificate *cert) ; |
const ne_ssl_dname *ne_ssl_cert_issuer( | const ne_ssl_certificate *cert) ; |
The function ne_ssl_cert_identity
retrieves the “identity” of a certificate; for an
SSL server certificate, this will be the hostname for which the
certificate was issued. In PKI parlance, the identity is the
common name attribute of the distinguished name of
the certificate subject.
The functions ne_ssl_cert_subject
and
ne_ssl_cert_issuer
can be used to access the
objects representing the distinguished name of the subject and of
the issuer of a certificate, respectively.
If a certificate object is part of a certificate chain, then
ne_ssl_cert_signedby
can be used to find the
certificate which signed a particular certificate. For a
self-signed certificate or a certificate for which the full chain
is not available, this function will return NULL
.
ne_ssl_cert_issuer
and
ne_ssl_cert_subject
are guaranteed to never
return NULL
. ne_ssl_cert_identity
may
return NULL
if the certificate has no specific
“identity”. ne_ssl_cert_signedby
may return NULL
as covered above.
The following function could be used to display information about a given certificate:
void dump_cert(const ne_ssl_certificate *cert) { const char *id = ne_ssl_cert_identity(cert); char *dn; if (id) printf("Certificate was issued for '%s'.\n", id); dn = ne_ssl_readable_dname(ne_ssl_cert_subject(cert)); printf("Subject: %s\n", dn); free(dn); dn = ne_ssl_readable_dname(ne_ssl_cert_issuer(cert)); printf("Issuer: %s\n", dn); free(dn); }
ne_buffer — string buffer handling
#include <ne_string.h> typedef struct { char *data; size_t used; size_t length; } ne_buffer;
The ne_buffer type represents an expandable
memory buffer for holding NUL
-terminated strings. The
data
field points to the beginnning of the
string, the length of which is given by the
used
field. The current size of memory
allocated is given by the length
field. It
is not recommended that the fields of a buffer are manipulated
directly. The data
pointer may change when
the buffer is modified.
A buffer is created using ne_buffer_create or ne_buffer_ncreate, and destroyed using ne_buffer_destroy or ne_buffer_finish. The functions ne_buffer_append, ne_buffer_zappend and ne_buffer_concat are used to append data to a buffer.
If the string referenced by the
data
pointer is modified directly (rather
than using one of the functions listed above),
ne_buffer_altered
must be called.
Table of Contents
This chapter provides an introduction to neon, giving an overview of the range of features offered, and some general guidelines for using the neon API.
neon aims to provide a modern, flexible, and simple API in the C programming language for implementing HTTP and WebDAV support. The WebDAV functionality is entirely separate from the basic HTTP functionality; neon can be used simply as an HTTP client library, ignoring the WebDAV support if desired.
neon-config — script providing information about installed copy of neon library
neon-config
[--prefix
] [[--cflags
] | [--libs
] | [--la-file
] | [--support
feature
] | [--help
] | [--version
]]
The neon-config script provides
information about an installed copy of the neon library. The
--cflags
and --libs
options instruct
how to compile and link an application against the library; the
--version
and --support
options can
help determine whether the library meets the applications
requirements.
| Print the flags which should be passed to the C compiler when compiling object files, when the object files use neon header files. |
| Print the flags which should be passed to the linker when linking an application which uses the neon library |
| Print the location of the libtool library
script, libneon.la , which can be used to link against
neon by applications using libtool. |
| Print the version of the library |
| If dir is given; relocate output of
--cflags and --libs as if neon was
installed in given prefix directory. Otherwise, print the
installation prefix of the library. |
| The script exits with success if
feature is supported by the
library. |
| Print help message; includes list of known features and whether they are supported or not. |
Below is a Makefile fragment which could be used to
build an application against an installed neon library, when the
neon-config script can be found in
$PATH
.
CFLAGS = `neon-config --cflags` LIBS = `neon-config --libs` OBJECTS = myapp.o TARGET = myapp $(TARGET): $(OBJECTS) $(CC) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) myapp.o: myapp.c $(CC) $(CFLAGS) -c myapp.c -o myapp.o
neon is intended to be compliant with the IETF and W3C standards which it implements, with a few exceptions due to practical necessity or interoperability issues. These exceptions are documented in this section.
neon is deliberately not compliant with section 23.4.2, and treats property names as a (namespace-URI, name) pair. This is generally considered to be correct behaviour by the WebDAV working group, and is likely to formally adopted in a future revision of the specification.
There is some confusion in this specification about the
use of the “identity”
transfer-coding. neon ignores the
Transfer-Encoding
response header if it
contains only the (now deprecated) “identity”
token, and will determine the response message length as if
the header was not present. neon will give an error if a
response includes a Transfer-Encoding
header with a value other than “identity” or
“chunked”.
neon is not strictly compliant with the quoting rules
given in the grammar for the Authorization
header. The grammar requires that the qop
and algorithm
parameters are not quoted,
however one widely deployed server implementation
(Microsoft® IIS 5) rejects the request if these parameters
are not quoted. neon sends these parameters with
quotes—this is not known to cause any problems with
other server implementations.
The neon XML parser interface will accept and parse
without error some XML documents which are well-formed
according to the XML specification but do not conform to the
"Namespaces in XML" specification [REC-XML-names]. Specifically: the restrictions on
the first character of the NCName
rule are
not all implemented; neon will allow any
CombiningChar
, Extender
and some characters from the Digit
class in
this position.
ne_ssl_clicert_read, ne_ssl_clicert_name, ne_ssl_clicert_encrypted, ne_ssl_clicert_decrypt, ne_ssl_clicert_owner, ne_ssl_clicert_free — SSL client certificate handling
#include <ne_ssl.h>
ne_ssl_client_cert *ne_ssl_clicert_read( | const char *filename) ; |
const char *ne_ssl_clicert_name( | const ne_ssl_client_cert *ccert) ; |
int ne_ssl_clicert_encrypted( | const ne_ssl_client_cert *ccert) ; |
int ne_ssl_clicert_decrypt( | ne_ssl_client_cert *ccert, |
const char *password) ; |
const ne_ssl_certificate *ne_ssl_clicert_owner( | const ne_ssl_client_cert *ccert) ; |
void ne_ssl_clicert_free( | ne_ssl_client_cert *ccert) ; |
The ne_ssl_clicert_read
function reads
a client certificate from a
PKCS#12-formatted file, and returns an
ne_ssl_client_cert object. If the client
certificate is encrypted, it must be decrypted before it is used.
An ne_ssl_client_cert object holds a client
certificate and the associated private key, not just a
certificate; the term "client certificate"
will used to refer to this pair.
A client certificate can be in one of two states:
encrypted or decrypted.
The ne_ssl_clicert_encrypted
function will
return non-zero if the client certificate is in the
encrypted state. A client certificate object
returned by ne_ssl_clicert_read
may be
initially in either state, depending on whether the file was
encrypted or not.
ne_ssl_clicert_decrypt
can be used to
decrypt a client certificate using the appropriate password. This
function must only be called if the object is in the
encrypted state; if decryption fails, the
certificate state does not change, so decryption can be attempted
more than once using different passwords.
A client certificate can be given a "friendly name" when it
is created; ne_ssl_clicert_name
will return
this name (or NULL
if no friendly name was specified).
ne_ssl_clicert_name
can be used when the
client certificate is in either the encrypted or decrypted state,
and will return the same string for the lifetime of the
object.
The function ne_ssl_clicert_owner
returns the certificate part of the client certificate; it must
only be called if the client certificate is in the
decrypted state.
When the client certificate is no longer needed, the
ne_ssl_clicert_free
function should be used
to destroy the object.
ne_ssl_clicert_read
returns a client
certificate object, or NULL
if the file could not be read.
ne_ssl_clicert_encrypted
returns zero if the
object is in the decrypted state, or non-zero if it is in the
encrypted state. ne_ssl_clicert_name
returns
a NUL
-terminated friendly name string, or NULL
.
ne_ssl_clicert_owner
returns a certificate
object.
The following code reads a client certificate and decrypts it if necessary, then loads it into an HTTP session.
ne_ssl_client_cert *ccert; ccert = ne_ssl_clicert_read("/path/to/client.p12"); if (ccert == NULL) { /* handle error... */ } else if (ne_ssl_clicert_encrypted(ccert)) { char *password = prompt_for_password(); if (ne_ssl_clicert_decrypt(ccert, password)) { /* could not decrypt! handle error... */ } } ne_ssl_set_clicert(sess, ccert);
ne_ssl_cert_cmp, ne_ssl_cert_free — functions to operate on certificate objects
#include <ne_header.h>
int ne_ssl_cert_cmp( | const ne_ssl_certificate *c1, |
const ne_ssl_certificate *c2) ; |
void ne_ssl_cert_free( | ne_ssl_certificate *cert) ; |
ne_xml_create, ne_xml_destroy — create and destroy an XML parser
#include <ne_xml.h>
ne_xml_parser *ne_xml_create( | void) ; |
void ne_xml_destroy( | ne_xml_parser *parser) ; |
ne_status — HTTP status structure
#include <ne_utils.h> typedef struct { int major_version, minor_version; int code, klass; const char *reason_phrase; } ne_status;
An ne_status type represents an HTTP
response status; used in response messages giving a result of request.
The major_version
and
minor_version
fields give the HTTP version
supported by the server issuing the response. The
code
field gives the status code of the
result (lying between 100 and 999 inclusive), and the
klass
field gives the
class[2], which is equal to the most significant digit
of the status.
There are five classes of HTTP status code defined by RFC2616:
| Informational response. |
| Success: the operation was successful |
| Redirection |
| Client error: the request made was incorrect in some manner. |
| Server error |
[2] the field is named “klass” not “class” so that the header can be used from a C++ program, in which “class” is a reserved word)
ne_buffer_create, ne_buffer_ncreate — create a string buffer
#include <ne_alloc.h>
ne_buffer *ne_buffer_create( | void) ; |
ne_buffer *ne_buffer_ncreate( | size_t size) ; |
ne_request_create, ne_request_dispatch, ne_request_destroy — low-level HTTP request handling
#include <ne_request.h>
ne_request *ne_request_create( | ne_session *session, |
const char *method, | |
const char *path) ; |
int ne_request_dispatch( | ne_request *req) ; |
void ne_request_destroy( | ne_request *req) ; |
An HTTP request, represented by the
ne_request type, specifies that some operation is to be
performed on some resource. The
ne_request_create
function creates a request
object, specifying the operation in the method
parameter. The location of the resource is determined by the server in
use for the session given by the sess
parameter, combined with the path
parameter.
The path
string used must conform to the
abs_path
definition given in RFC2396, with an
optional "?query" part, and must be URI-escaped by the caller (for
instance, using ne_path_escape
). If the string
comes from an untrusted source, failure to perform URI-escaping
results in a security vulnerability.
To dispatch a request, and process the response, the
ne_request_dispatch
function can be used. An
alternative is to use the (more complex, but more flexible)
combination of the ne_begin_request
,
ne_end_request
, and
ne_read_response_block
functions; see
ne_begin_request
.
To add extra headers in the request, the functions ne_add_request_header and ne_print_request_header can be used. To include a message
body with the request, one of the functions
ne_set_request_body_buffer
, ne_set_request_body_fd, or
ne_set_request_body_provider
can be used.
The return value of
ne_request_dispatch
indicates merely whether the
request was sent and the response read successfully. To discover the
result of the operation, ne_get_status, along with
any processing of the response headers and message body.
A request can only be dispatched once: calling
ne_request_dispatch
more than once on a
single ne_request object produces undefined
behaviour. Once all processing associated with the request
object is complete, use the
ne_request_destroy
function to destroy
the resources associated with it. Any subsequent use of the
request object produces undefined behaviour.
If a request is being using a non-idempotent method such
as POST
, the
NE_REQFLAG_IDEMPOTENT
flag should be
disabled; see ne_set_request_flag.
The ne_request_create
function
returns a pointer to a request object (and never NULL
).
The ne_request_dispatch
function
returns zero if the request was dispatched successfully, and a
non-zero error code otherwise.
NE_ERROR | Request failed (see session error string) |
NE_LOOKUP | The DNS lookup for the server (or proxy server) failed. |
NE_AUTH | Authentication failed on the server. |
NE_PROXYAUTH | Authentication failed on the proxy server. |
NE_CONNECT | A connection to the server could not be established. |
NE_TIMEOUT | A timeout occurred while waiting for the server to respond. |
An example of applying a MKCOL
operation to the resource at the location
http://www.example.com/foo/bar/
:
ne_session *sess = ne_session_create("http", "www.example.com", 80); ne_request *req = ne_request_create(sess, "MKCOL", "/foo/bar/"); if (ne_request_dispatch(req)) { printf("Request failed: %s\n", ne_get_error(sess)); } ne_request_destroy(req);
ne_shave — trim whitespace from a string
#include <ne_string.h>
char *ne_shave( | char *str, |
const char *whitespace) ; |
This section describes how to add neon support to an application. If you just want to quickly try out neon, use the neon-config script.
The neon source code is designed to be easily embedded into an application source tree. neon has no dependencies on libraries other than an SSL toolkit and XML parser, though the source tree can be configured to have no support for SSL or XML if desired. To configure the neon source code some GNU autoconf macros are supplied, which can be used in a number of ways, as follows:
autoconf macros are distributed in the 'macros' subdirectory of the neon distribution. Use the NEON_LIBRARY macro from your configure.in to check for the presence of the neon library installed on the system. The macro adds an '--with-neon=...' argument to configure, which allows the user to specify a location for the library (the standard /usr and /usr/local directories are checked automatically without having to be specified).
The 'src' directory of the neon package can be imported directly into your application, if you do not wish to add an external dependency. If you wish to bundle, use the NEON_BUNDLED macro to configure neon in your application: here, the neon sources are bundled in a directory called 'libneon':
NEON_BUNDLED(libneon, ...)
If your application supports builds where srcdir != builddir, you should use the NEON_VPATH_BUNDLED macro like this:
NEON_VPATH_BUNDLED(${srcdir}/libneon, libneon, ...)
If you use this macro, a '--with-included-neon' option will be added to the generated configure script. This allows the user to force the bundled neon to be used in the application, rather than any neon library found on the system. If you allow neon to be configured this way, you must also configure an XML parser. Use the NEON_XML_PARSER macro to do this.
The final argument to the _BUNDLED macros is a set of actions which are executed if the bundled build *is* chosen (rather than an external neon which might have been found on the user's system). In here, use either the NEON_LIBTOOL_BUILD or NEON_NORMAL_BUILD macro to set up the neon Makefile appropriately: including adding the neon source directory to the recursive make.
A full fragment might be:
NEON_BUNDLED(libneon, [ NEON_NORMAL_BUILD NEON_XML_PARSER SUBDIRS="libneon $SUBDIRS" ])
This means the bundled neon source directory (called 'libneon') is used if no neon is found on the system, and the standard XML parser search is used.
ne_version_match, ne_version_string — library versioning
#include <ne_utils.h>
int ne_version_match( | int major, |
int minor) ; |
const char *ne_version_string( | void) ; |
The ne_version_match
function returns
non-zero if the library version is not of major version
major
, or the minor version is less than
minor
. For neon versions 0.x, every
minor version is assumed to be incompatible with every other minor
version.
The ne_version_string
function returns
a string giving the library version.
ne_ssl_cert_read, ne_ssl_cert_write, ne_ssl_cert_import, ne_ssl_cert_export — functions to read or write certificates to and from files or strings
#include <ne_ssl.h>
ne_ssl_certificate *ne_ssl_cert_read( | const char *filename) ; |
int ne_ssl_cert_write( | const ne_ssl_certificate *cert, |
const char *filename) ; |
ne_ssl_certificate *ne_ssl_cert_import( | const char *data) ; |
char *ne_ssl_cert_export( | const ne_ssl_certificate *cert) ; |
The ne_ssl_cert_write
function writes a
certificate to a file using the PEM encoding. The
ne_ssl_cert_export
function returns a
base64-encoded NUL
-terminated string representing the
certificate. This string is malloc-allocated and should be
destroyed using free
by the caller.
The ne_ssl_cert_read
function reads a
certificate from a PEM-encoded file, and returns a certificate
object. The ne_ssl_cert_import
function
returns a certificate object from a base64-encoded string,
data
, as returned by
ne_ssl_cert_export
. The certificate object
returned by these functions should be destroyed using ne_ssl_cert_free after use.
ne_ssl_cert_read
returns NULL
if a
certificate could not be read from the file.
ne_ssl_cert_write
returns non-zero if the
certificate could not be written to the file.
ne_ssl_cert_export
always returns a
NUL
-terminated string, and never NULL
.
ne_ssl_cert_import
returns NULL
if the
string was not a valid base64-encoded certificate.
The string produced by
ne_ssl_cert_export
is the base64 encoding of
the DER representation of the certificate. The file written by
ne_ssl_cert_write
uses the PEM format: this
is the base64 encoding of the DER representation with newlines
every 64 characters, and start and end marker lines.
ne_set_server_auth, ne_set_proxy_auth, ne_forget_auth — register authentication callbacks
#include <ne_auth.h>
typedef int (*ne_auth_creds)( | void *userdata, |
const char *realm, | |
int attempt, | |
char *username, | |
char *password) ; |
void ne_set_server_auth( | ne_session *session, |
ne_auth_creds callback, | |
void *userdata) ; |
void ne_set_proxy_auth( | ne_session *session, |
ne_auth_creds callback, | |
void *userdata) ; |
void ne_forget_auth( | ne_session *session) ; |
The ne_auth_creds function type defines a
callback which is invoked when a server or proxy server requires user
authentication for a particular request. The
realm
string is supplied by the server. The attempt
is a counter giving the
number of times the request has been retried with different
authentication credentials. The first time the callback is invoked
for a particular request, attempt
will be zero.
To retry the request using new authentication
credentials, the callback should return zero, and the
username
and password
buffers must contain NUL
-terminated strings. The
NE_ABUFSIZ
constant gives the size of these
buffers.
If you only wish to allow the user one attempt to enter
credentials, use the value of the attempt
parameter as the return value of the callback.
To abort the request, the callback should return a
non-zero value; in which case the contents of the
username
and password
buffers are ignored.
The ne_forget_auth
function can be
used to discard the cached authentication credentials.
/* Function which prompts for a line of user input: */ extern char *prompt_for(const char *prompt); static int my_auth(void *userdata, const char *realm, int attempts, char *username, char *password) { strncpy(username, prompt_for("Username: "), NE_ABUFSIZ); strncpy(password, prompt_for("Password: "), NE_ABUFSIZ); return attempts; } int main(...) { ne_session *sess = ne_session_create(...); ne_set_server_auth(sess, my_auth, NULL); /* ... */ }
ne_token, ne_qtoken — string tokenizers
#include <ne_string.h>
char *ne_token( | char **str, |
char sep) ; |
char *ne_qtoken( | char **str, |
char sep, | |
const char *quotes) ; |
ne_token
and
ne_qtoken
tokenize the string at the location
stored in the pointer str
. Each time the
function is called, it returns the next token, and modifies the
str
pointer to point to the remainer of the
string, or NULL
if there are no more tokens in the string. A token
is delimited by the separator character sep
; if
ne_qtoken
is used any quoted segments of the
string are skipped when searching for a separator. A quoted segment
is enclosed in a pair of one of the characters given in the
quotes
string.
The string being tokenized is modified each time
the tokenizing function is called; replacing the next separator
character with a NUL
terminator.
ne_malloc, ne_calloc, ne_realloc, ne_strdup, ne_strndup, ne_oom_callback — memory allocation wrappers
#include <ne_alloc.h>
void *ne_malloc( | size_t size) ; |
void *ne_calloc( | size_t size) ; |
void *ne_realloc( | void *size, |
size_t len) ; |
char *ne_strdup( | const char *s) ; |
char *ne_strndup( | const char *s, |
size_t size) ; |
void ne_oom_callback( | void (*callback)(void)) ; |
The functions ne_malloc
,
ne_calloc
, ne_realloc
,
ne_strdup
and ne_strdnup
provide wrappers for the equivalent functions in the standard C
library. The wrappers provide the extra guarantee that if the C
library equivalent returns NULL
when no memory is available, an
optional callback will be called, and the library will then call
abort
().
ne_oom_callback
registers a callback
which will be invoked if an out of memory error is detected.
ne_iaddr_make, ne_iaddr_cmp, ne_iaddr_print, ne_iaddr_typeof, ne_iaddr_free — functions to manipulate and compare network addresses
#include <ne_socket.h> typedef enum { ne_iaddr_ipv4 = 0, ne_iaddr_ipv6 } ne_iaddr_type;
ne_inet_addr *ne_iaddr_make( | ne_iaddr_type type, |
const unsigned char *raw) ; |
int ne_iaddr_cmp( | const ne_inet_addr *ia1, |
const ne_inet_addr *ia2) ; |
char *ne_iaddr_print( | const ne_inet_addr *ia, |
char *buffer, | |
size_t bufsiz) ; |
ne_iaddr_type ne_iaddr_typeof( | const ne_inet_addr *ia) ; |
void ne_iaddr_free( | const ne_inet_addr *ia) ; |
ne_iaddr_make
creates an
ne_inet_addr object from a raw binary network
address; for instance the four bytes 0x7f 0x00 0x00
0x01
represent the IPv4 address
127.0.0.1
. The object returned is suitable for
passing to ne_sock_connect
. A binary IPv4
address contains four bytes; a binary IPv6 address contains
sixteen bytes; addresses passed must be in network byte
order.
ne_iaddr_cmp
can be used to compare two
network addresses; returning zero only if they are identical. The
addresses need not be of the same address type; if the addresses
are not of the same type, the return value is guaranteed to be
non-zero.
ne_iaddr_print
can be used to print the
human-readable string representation of a network address into a
buffer, for instance the string
"127.0.0.1"
.
ne_iaddr_typeof
returns the type of the
given network address.
ne_iaddr_free
releases the memory
associated with a network address object.
ne_iaddr_make
returns NULL
if the
address type passed is not supported (for instance on a platform
which does not support IPv6).
ne_iaddr_print
returns the
buffer
pointer, and never NULL
.
The following example connects a socket to port 80 at the
address 127.0.0.1
.
unsigned char addr[] = "\0x7f\0x00\0x00\0x01"; ne_inet_addr *ia; ia = ne_iaddr_make(ne_iaddr_ipv4, addr); if (ia != NULL) { ne_socket *sock = ne_sock_connect(ia, 80); ne_iaddr_free(ia); /* ... */ } else { /* ... */ }
ne_buffer_append, ne_buffer_zappend, ne_buffer_concat — append data to a string buffer
#include <ne_string.h>
void ne_buffer_append( | ne_buffer *buf, |
const char *string, | |
size_t len) ; |
void ne_buffer_zappend( | ne_buffer *buf, |
const char *string) ; |
void ne_buffer_concat( | ne_buffer *buf, |
const char *str, | |
...) ; |
The ne_buffer_append
and
ne_buffer_zappend
functions append a string to
the end of a buffer; extending the buffer as necessary. The
len
passed to
ne_buffer_append
specifies the length of the
string to append; there must be no NUL
terminator in the first
len
bytes of the string.
ne_buffer_zappend
must be passed a
NUL
-terminated string.
The ne_buffer_concat
function takes
a variable-length argument list following str
;
each argument must be a char * pointer to a
NUL
-terminated string. A NULL
pointer must be given as the last
argument to mark the end of the list. The strings (including
str
) are appended to the buffer in the order
given. None of the strings passed to
ne_buffer_concat
are modified.
The neon XML interface is exposed by the
ne_xml.h
header file. This interface gives a
wrapper around the standard SAX API used by XML
parsers, with an additional abstraction, stacked SAX
handlers, and also giving consistent XML Namespace support.
A SAX-based parser works by emitting a sequence of events to reflect the tokens being parsed from the XML document. For example, parsing the following document fragment:
<hello>world</hello>
results in the following events:
This example demonstrates the three event types used used in the subset of SAX exposed by the neon XML interface: start-element, character-data and end-element. In a C API, an “event” is implemented as a function callback; three callback types are used in neon, one for each type of event.
WebDAV property values are represented as fragments of XML,
transmitted as parts of larger XML documents over HTTP (notably in
the body of the response to a PROPFIND
request).
When neon parses such documents, the SAX events generated for
these property value fragments may need to be handled by the
application, since neon has no knowledge of the structure of
properties used by the application.
To solve this problem[1] the neon XML interface introduces the concept of a SAX handler. A SAX handler comprises a start-element, character-data and end-element callback; the start-element callback being defined such that each handler may accept or decline the start-element event. Handlers are composed into a handler stack before parsing a document. When a new start-element event is generated by the XML parser, neon invokes each start-element callback in the handler stack in turn until one accepts the event. The handler which accepts the event will then be subsequently be passed character-data events if the element contains character data, followed by an end-element event when the element is closed. If no handler in the stack accepts a start-element event, the branch of the tree is ignored.
To illustrate, given a handler A, which accepts the
cat
and age
elements, and a
handler B, which accepts the name
element, the
following document:
would be parsed as follows:
The search for a handler which will accept a start-element event
begins at the handler of the parent element and continues toward the
top of the stack. For the root element, it begins at the base of
the stack. In the above example, handler A is at the base, and
handler B at the top; if the name
element had any
children, only B's start-element would be invoked to accept
them.
To facilitate communication between independent handlers, a state integer is associated with each element being parsed. This integer is returned by start-element callback and is passed to the subsequent character-data and end-element callbacks associated with the element. The state integer of the parent element is also passed to each start-element callback, the value zero used for the root element (which by definition has no parent).
To further extend Example 2.1, “An example XML document”: if handler A
defines that the state of the root element cat
will be 42
, the event trace would be as
follows:
To avoid collisions between state integers used by different handlers, the interface definition of any handler includes the range of integers it will use.
To support XML namespaces, every element name is represented
as a (namespace, name) pair. The start-element
and end-element callbacks are passed namespace and name strings
accordingly. If an element in the XML document has no declared
namespace, the namespace given will be the empty string,
""
.
[1] This “problem” only needs solving because the SAX interface is so inflexible when implemented as C function callbacks; a better approach would be to use an XML parser interface which is not based on callbacks.
ne_set_session_flag, ne_get_session_flag — set and retrieve session flags
#include <ne_request.h>
void ne_set_session_flag( | ne_session *sess, |
ne_session_flag flag, | |
int value) ; |
int ne_get_session_flag( | ne_session *sess, |
ne_session_flag flag) ; |
The ne_set_session_flag
function
enables or disables a session flag. Passing a non-zero
value
argument enables the flag, and zero
disables it.
The following flags are defined:
| disable this flag to prevent use of persistent connections |
| enable this flag to enable support for non-HTTP ShoutCast-style "ICY" responses |
| disable this flag to disable support for the SSLv2 protocol |
| enable this flag to enable support for RFC4918-only WebDAV features; losing backwards-compatibility with RFC2518 servers |
| enable this flag if an RFC-violating connection-based HTTP authentication scheme is in use |
| disable this flag if a server is used which does not correctly support the TLS SNI extension |
| enable this flag to enable the request flag
NE_REQFLAG_EXPECT100 for new
requests |
ne_sock_init, ne_sock_exit — perform library initialization
#include <ne_socket.h>
int ne_sock_init( | void) ; |
void ne_sock_exit( | void) ; |
In some platforms and configurations, neon may be using
some socket or SSL libraries which require global initialization
before use. To perform this initialization, the
ne_sock_init
function must be called before
any other library functions are used.
Once all use of neon is complete,
ne_sock_exit
can be called to perform
de-initialization of socket or SSL libraries, if necessary. Uses
of ne_sock_init
and
ne_sock_exit
are "reference counted"; if N
calls to ne_sock_init
are made, only the Nth
call to ne_sock_exit
will have effect.
ne_sock_init
will set the disposition
of the SIGPIPE
signal to
ignored. No change is made to the
SIGPIPE
disposition by
ne_sock_exit
.
Both the SSL libraries supported by neon — OpenSSL and GnuTLS — require callbacks to be registered to allow thread-safe use of SSL. These callbacks are stored as global variables and so their state persists for as long as the library in question is loaded into the process. If multiple users of the SSL library exist within the process, this can be problematic, particularly if one is dynamically loaded (and may subsequently be unloaded).
If neon is configured using the
--enable-threadsafe-ssl
flag, thread-safe SSL
support will be enabled automatically, as covered in the following
section. Otherwise, it is not safe to use neon with SSL in a
multi-threaded process. The ne_has_support
function can be used to determine whether neon is built to
enable thread-safety support in the SSL library.
neon follows two simple rules when dealing with the OpenSSL locking callbacks:
ne_sock_init
will set
thread-safety locking callbacks if and only if no locking
callbacks are already registered.ne_sock_exit
will
unset the thread-safety locking callbacks if and only if the
locking callbacks registered are those registered by
ne_sock_init
.Applications and libraries should be able to co-operate to ensure that SSL use is always thread-safe if similar rules are always followed.
The cryptography library used by GnuTLS, libgcrypt, only
supports an initialization operation to register thread-safety
callbacks. ne_sock_init
will register the
thread-safe locking callbacks on first use;
ne_sock_exit
cannot unregister them. If
multiple users of GnuTLS are present within the process, it is
unsafe to dynamically unload neon from the process if neon
is configured with thread-safe SSL support enabled (since the
callbacks would be left pointing at unmapped memory once neon
is unloaded).
ne_get_status — retrieve HTTP response status for request
#include <ne_request.h>
const ne_status *ne_get_status( | const ne_request *request) ; |
The ne_get_status
function returns
a pointer to the HTTP status object giving the result of a request.
The object returned only becomes valid once the request has been
successfully dispatched (the return value of
ne_request_dispatch
or
ne_begin_request
was zero). The object remains
valid until the associated request object is destroyed.
ne_ssl_set_verify — register an SSL certificate verification callback
#include <ne_session.h>
typedef int ne_ssl_verify_fn( | void *userdata, |
int failures, | |
const ne_ssl_certificate *cert) ; |
void ne_ssl_set_verify( | ne_session *session, |
ne_ssl_verify_fn verify_fn, | |
void *userdata) ; |
To enable manual SSL certificate verification, a
callback can be registered using
ne_ssl_set_verify
. If such a callback is not
registered, when a connection is established to an SSL server which
does not present a certificate signed by a trusted CA (see ne_ssl_trust_cert), or if the certificate presented is invalid in
some way, the connection will fail.
When the callback is invoked, the
failures
parameter gives a bitmask indicating
in what way the automatic certificate verification failed. The value
is equal to the bit-wise OR of one or more of the following
constants (and is guaranteed to be non-zero):
| The certificate is not yet valid. |
| The certificate has expired. |
| The hostname used for the session does not match the hostname to which the certificate was issued. |
| The Certificate Authority which signed the certificate is not trusted. |
Note that if either of the
NE_SSL_IDMISMATCH
or
NE_SSL_UNTRUSTED
failures is given, the
connection may have been intercepted by a third party, and
must not be presumed to be “secure”.
The cert
parameter passed to the
callback represents the certificate which was presented by the server.
If the server presented a chain of certificates, the chain can be
accessed using ne_ssl_cert_signedby. The
cert
object given is not valid after the
callback returns.
The verification callback must return zero to indicate that the certificate should be trusted; and non-zero otherwise (in which case, the connection will fail).
The following code implements an example verification
callback, using the dump_cert
function
from ne_ssl_cert_subject to display
certification information. Notice that the hostname of the
server used for the session is passed as the
userdata
parameter to the
callback.
static int my_verify(void *userdata, int failures, const ne_ssl_certificate *cert) { const char *hostname = userdata; dump_cert(cert); puts("Certificate verification failed - the connection may have been " "intercepted by a third party!"); if (failures & NE_SSL_IDMISMATCH) { const char *id = ne_ssl_cert_identity(cert); if (id) printf("Server certificate was issued to '%s' not '%s'.\n", id, hostname); else printf("The certificate was not issued for '%s'\n", hostname); } if (failures & NE_SSL_UNTRUSTED) puts("The certificate is not signed by a trusted Certificate Authority."); /* ... check for validity failures ... */ if (prompt_user()) return 1; /* fail verification */ else return 0; /* trust the certificate anyway */ } int main(...) { ne_session *sess = ne_session_create("https", "some.host.name", 443); ne_ssl_set_verify(sess, my_verify, "some.host.name"); ... }
The documentation for the neon interface is split between this chapter, which gives a broad introduction to the abstractions exposed by the library, and neon API reference, which gives a function-by-function breakdown of the interface.
ne_has_support — determine feature support status
#include <ne_utils.h>
int ne_has_support( | int feature) ; |
The ne_has_support
function can be used
to determine whether a particular optional feature, given by the
feature code feature
, is supported. The
following feature codes are available:
| Indicates support for SSL/TLS |
| Indicates support for compressed responses |
| Indicates support for IPv6 |
| Indicates support for large files |
| Indicates support for SOCKSv5 |
| Indicates support for thread-safe SSL initialization — see ne_sock_init |
ne_session_create, ne_close_connection, ne_session_proxy, ne_session_destroy — set up HTTP sessions
#include <ne_session.h>
ne_session *ne_session_create( | const char *scheme, |
const char *hostname, | |
unsigned int port) ; |
void ne_session_proxy( | ne_session *session, |
const char *hostname, | |
unsigned int port) ; |
void ne_close_connection( | ne_session *session) ; |
void ne_session_destroy( | ne_session *session) ; |
An ne_session object represents an HTTP session - a logical grouping of a sequence of HTTP requests made to a certain server. Any requests made using the session can use a persistent connection, share cached authentication credentials and any other common attributes.
A new HTTP session is created using
ne_session_create
, giving the
hostname
and port
of the
server to use, along with the scheme
used to
contact the server (usually "http"
). Before the
first use of ne_session_create
in a process,
ne_sock_init must have been called to perform any
global initialization needed by any libraries used by neon.
To enable SSL/TLS for the session, pass the string
"https"
as the scheme
parameter, and either register a certificate verification function
(see ne_ssl_set_verify) or trust the appropriate
certificate (see ne_ssl_trust_cert, ne_ssl_trust_default_ca).
If an HTTP proxy server should be used for the session,
ne_session_proxy
must be called giving
the hostname and port on which to contact the proxy.
Further per-session options may be changed using the ne_set_request_flag interface.
If it is known that the session will not be used for a
significant period of time, ne_close_connection
can be called to close the connection, if one remains open. Use of
this function is entirely optional, but it must not be called if there
is a request active using the session.
Once a session has been completed,
ne_session_destroy
must be called to destroy the
resources associated with the session. Any subsequent use of the
session pointer produces undefined behaviour.
The hostname passed to
ne_session_create
is resolved when the first
request using the session is dispatched; a DNS resolution failure can
only be detected at that time (using the NE_LOOKUP
error code); see ne_request_dispatch for
details.
ne_addr_resolve, ne_addr_result, ne_addr_first, ne_addr_next, ne_addr_error, ne_addr_destroy — functions to resolve hostnames to addresses
#include <ne_socket.h>
ne_sock_addr *ne_addr_resolve( | const char *hostname, |
int flags) ; |
int ne_addr_result( | const ne_sock_addr *addr) ; |
const ne_inet_addr *ne_addr_first( | ne_sock_addr *addr) ; |
const ne_inet_addr *ne_addr_next( | ne_sock_addr *addr) ; |
char *ne_addr_error( | const ne_sock_addr *addr, |
char *buffer, | |
size_t bufsiz) ; |
void ne_addr_destroy( | ne_sock_addr *addr) ; |
The ne_addr_resolve
function resolves
the given hostname
, returning an
ne_sock_addr object representing the address (or
addresses) associated with the hostname. The
flags
parameter is currently unused, and
must be passed as 0.
The hostname
passed to
ne_addr_resolve
can be a DNS hostname
(e.g. "www.example.com"
) or an IPv4 dotted quad
(e.g. "192.0.34.72"
); or, on systems which
support IPv6, an IPv6 hex address, which may be enclosed in
brackets, e.g. "[::1]"
.
To determine whether the hostname was successfully resolved,
the ne_addr_result
function is used, which
returns non-zero if an error occurred. If an error did occur, the
ne_addr_error
function can be used, which
will copy the error string into a given
buffer
(of size
bufsiz
).
The functions ne_addr_first
and
ne_addr_next
are used to retrieve the
Internet addresses associated with an address object which has
been successfully resolved. ne_addr_first
returns the first address; ne_addr_next
returns the next address after the most recent call to
ne_addr_next
or
ne_addr_first
, or NULL
if there are no more
addresses. The ne_inet_addr pointer returned by
these functions can be passed to
ne_sock_connect
to connect a socket.
After the address object has been used, it should be
destroyed using ne_addr_destroy
.
ne_addr_resolve
returns a pointer to an
address object, and never NULL
.
ne_addr_error
returns the
buffer
parameter .
The code below prints out the set of addresses associated
with the hostname www.google.com
.
ne_sock_addr *addr; char buf[256]; addr = ne_addr_resolve("www.google.com", 0); if (ne_addr_result(addr)) { printf("Could not resolve www.google.com: %s\n", ne_addr_error(addr, buf, sizeof buf)); } else { const ne_inet_addr *ia; printf("www.google.com:"); for (ia = ne_addr_first(addr); ia != NULL; ia = ne_addr_next(addr)) { printf(" %s", ne_iaddr_print(ia, buf, sizeof buf)); } putchar('\n'); } ne_addr_destroy(addr);
ne_i18n_init — functions to initialize internationalization support
#include <ne_i18n.h>
void ne_i18n_init( | const char *encoding) ; |
The ne_i18n_init
function can be used
to enable support for translated messages in the neon library.
The encoding
parameter, if non-NULL
,
specifies the character encoding required for generated translated
string. If it is NULL
, the appropriate character encoding for
the process locale will be used.
This call is only strictly necessary if either:
gettext
implementation on
which it depends for i18n purposes, orIf ne_i18n_init
is never called, the
message catalogs will not be found if case (a) applies (and so
English error messages will be used), and will use the default
character encoding specified by the process locale. The library
will otherwise operate correctly.
Note that the encoding used is a process-global setting and
so results may be unexpected if other users of neon within the
process call ne_i18n_init
with a different
encoding parameter.