355b4669e025ff377602b6fc7caaf30dbc218371jacobs/*
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER START
355b4669e025ff377602b6fc7caaf30dbc218371jacobs *
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * The contents of this file are subject to the terms of the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Common Development and Distribution License (the "License").
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You may not use this file except in compliance with the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs *
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * or http://www.opensolaris.org/os/licensing.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * See the License for the specific language governing permissions
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * and limitations under the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs *
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * When distributing Covered Code, include this CDDL HEADER in each
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * If applicable, add the following below this CDDL HEADER, with the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * fields enclosed by brackets "[]" replaced with your own identifying
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * information: Portions Copyright [yyyy] [name of copyright owner]
355b4669e025ff377602b6fc7caaf30dbc218371jacobs *
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER END
355b4669e025ff377602b6fc7caaf30dbc218371jacobs */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/*
223f6c28404c8d330c123e98936160b8da9a26b2jacobs * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Use is subject to license terms.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs *
355b4669e025ff377602b6fc7caaf30dbc218371jacobs */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#ifndef _PAPI_IMPL_H
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#define _PAPI_IMPL_H
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/* $Id: papi_impl.h 161 2006-05-03 04:32:59Z njacobs $ */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#pragma ident "%Z%%M% %I% %E% SMI"
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#include <papi.h>
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#ifdef __cplusplus
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern "C" {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#endif
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#include <time.h>
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#include <sys/types.h>
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#include <stdarg.h>
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#include <uri.h>
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#include <http.h>
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#include <ipp.h>
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/*
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Implementation specific types/prototypes/definitions follow
355b4669e025ff377602b6fc7caaf30dbc218371jacobs *
355b4669e025ff377602b6fc7caaf30dbc218371jacobs *
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Ex:
355b4669e025ff377602b6fc7caaf30dbc218371jacobs */
355b4669e025ff377602b6fc7caaf30dbc218371jacobstypedef enum {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs TRANSFER_ENCODING_CHUNKED,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs TRANSFER_ENCODING_LENGTH
355b4669e025ff377602b6fc7caaf30dbc218371jacobs} http_transfer_encoding_t;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobstypedef struct {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t **attributes;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs char *name;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs char *user;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs char *password;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs int (*authCB)(papi_service_t svc, void *app_data);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_encryption_t encryption;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs void *app_data;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs uri_t *uri;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs char *post;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs http_t *connection;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs http_transfer_encoding_t transfer_encoding;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs} service_t;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobstypedef struct job {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t **attributes;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs} job_t;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobstypedef struct {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t **attributes;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs} printer_t;
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/* IPP glue interfaces */
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern ssize_t ipp_request_read(void *fd, void *buffer, size_t length);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern ssize_t ipp_request_write(void *fd, void *buffer, size_t length);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern papi_status_t ipp_send_request(service_t *svc,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t **request,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t ***response);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern papi_status_t ipp_send_request_with_file(service_t *svc,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t **request,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t ***response, char *file);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern papi_status_t ipp_send_initial_request_block(service_t *svc,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t **request, ssize_t file_size);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern papi_status_t ipp_status_info(service_t *svc,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t **response);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern void ipp_initialize_request(service_t *svc,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t ***request, uint16_t type);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern void ipp_initialize_operational_attributes(service_t *svc,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t ***op,
223f6c28404c8d330c123e98936160b8da9a26b2jacobs char *printer, int job_id);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern papi_status_t ipp_to_papi_status(uint16_t status);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern papi_status_t http_to_papi_status(http_status_t status);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/* service related interfaces */
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern void detailed_error(service_t *svc, char *fmt, ...);
355b4669e025ff377602b6fc7caaf30dbc218371jacobsextern papi_status_t service_connect(service_t *svc, char *service_name);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#ifdef __cplusplus
355b4669e025ff377602b6fc7caaf30dbc218371jacobs}
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#endif
355b4669e025ff377602b6fc7caaf30dbc218371jacobs
355b4669e025ff377602b6fc7caaf30dbc218371jacobs#endif /* _PAPI_IMPL_H */