Index: cups/ipp.h =================================================================== --- cups/ipp.h (révision 6273) +++ cups/ipp.h (copie de travail) @@ -254,7 +254,8 @@ CUPS_GET_DEVICES, /* Get a list of supported devices */ CUPS_GET_PPDS, /* Get a list of supported drivers */ CUPS_MOVE_JOB, /* Move a job to a different printer */ - CUPS_AUTHENTICATE_JOB /* Authenticate a job @since CUPS 1.2@ */ + CUPS_AUTHENTICATE_JOB, /* Authenticate a job @since CUPS 1.2@ */ + CUPS_GET_VERSION /* Get CUPS' version */ } ipp_op_t; /* Old names for the operations */ Index: scheduler/ipp.c =================================================================== --- scheduler/ipp.c (révision 6273) +++ scheduler/ipp.c (copie de travail) @@ -27,6 +27,7 @@ * Contents: * * cupsdProcessIPPRequest() - Process an incoming IPP request... + * get_version() - Get CUPS' version. * accept_jobs() - Accept print jobs to a printer. * add_class() - Add a class to the system. * add_file() - Add a file to a job. @@ -118,6 +119,7 @@ * Local functions... */ +static void get_version(cupsd_client_t *con); static void accept_jobs(cupsd_client_t *con, ipp_attribute_t *uri); static void add_class(cupsd_client_t *con, ipp_attribute_t *uri); static int add_file(cupsd_client_t *con, cupsd_job_t *job, @@ -569,6 +571,10 @@ authenticate_job(con, uri); break; + case CUPS_GET_VERSION : + get_version(con); + break; + case IPP_CREATE_PRINTER_SUBSCRIPTION : case IPP_CREATE_JOB_SUBSCRIPTION : create_subscription(con, uri); @@ -690,7 +696,27 @@ } } +/* + * 'get_version()' - Get CUPS' version. + */ +static void +get_version(cupsd_client_t *con) /* I - Client connection */ +{ + cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_version(%p[%d])", con, + con->http.fd); + + ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_TEXT, "cups-version", NULL, + CUPS_SVERSION); + + /* + * Everything was ok, so return OK status... + */ + + con->response->request.status.status_code = IPP_OK; +} + + /* * 'accept_jobs()' - Accept print jobs to a printer. */