ncpl_misc.c (52626) | ncpl_misc.c (52704) |
---|---|
1/* 2 * Copyright (c) 1999, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1999, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/lib/libncp/ncpl_misc.c 52626 1999-10-29 12:59:59Z bp $ | 32 * $FreeBSD: head/lib/libncp/ncpl_misc.c 52704 1999-10-31 03:39:03Z bp $ |
33 * 34 * calls that don't fit to any other category 35 * 36 */ 37#include <sys/types.h> 38#include <sys/time.h> 39#include <errno.h> 40#include <stdio.h> --- 19 unchanged lines hidden (view full) --- 60 61 if (u_time.tm_year < 80) { 62 u_time.tm_year += 100; 63 } 64 return mktime(&u_time); 65} 66 67int | 33 * 34 * calls that don't fit to any other category 35 * 36 */ 37#include <sys/types.h> 38#include <sys/time.h> 39#include <errno.h> 40#include <stdio.h> --- 19 unchanged lines hidden (view full) --- 60 61 if (u_time.tm_year < 80) { 62 u_time.tm_year += 100; 63 } 64 return mktime(&u_time); 65} 66 67int |
68ncp_get_file_server_information(int connid, struct ncp_file_server_info *target) | 68ncp_get_file_server_information(NWCONN_HANDLE connid, 69 struct ncp_file_server_info *target) |
69{ 70 int error; 71 DECLARE_RQ; 72 73 ncp_init_request_s(conn, 17); 74 if ((error = ncp_request(connid, 23, conn)) != 0) 75 return error; 76 memcpy(target, ncp_reply_data(conn, 0), sizeof(*target)); --- 4 unchanged lines hidden (view full) --- 81 target->MaxConnectionsEverUsed 82 = htons(target->MaxConnectionsEverUsed); 83 target->NumberMountedVolumes 84 = htons(target->NumberMountedVolumes); 85 return 0; 86} 87 88int | 70{ 71 int error; 72 DECLARE_RQ; 73 74 ncp_init_request_s(conn, 17); 75 if ((error = ncp_request(connid, 23, conn)) != 0) 76 return error; 77 memcpy(target, ncp_reply_data(conn, 0), sizeof(*target)); --- 4 unchanged lines hidden (view full) --- 82 target->MaxConnectionsEverUsed 83 = htons(target->MaxConnectionsEverUsed); 84 target->NumberMountedVolumes 85 = htons(target->NumberMountedVolumes); 86 return 0; 87} 88 89int |
89ncp_get_stations_logged_info(int connid, u_int32_t connection, 90 struct ncp_bindery_object *target, 91 time_t *login_time) | 90ncp_get_stations_logged_info(NWCONN_HANDLE connid, u_int32_t connection, 91 struct ncp_bindery_object *target, time_t *login_time) |
92{ 93 int error; 94 DECLARE_RQ; 95 96 ncp_init_request_s(conn, 28); 97 ncp_add_dword_lh(conn, connection); 98 99 if ((error = ncp_request(connid, 23, conn)) != 0) 100 return error; 101 bzero(target, sizeof(*target)); 102 target->object_id = ncp_reply_dword_hl(conn, 0); 103 target->object_type = ncp_reply_word_hl(conn, 4); 104 memcpy(target->object_name, ncp_reply_data(conn, 6), 105 sizeof(target->object_name)); 106 *login_time = ncp_nw_to_ctime((struct nw_time_buffer *)ncp_reply_data(conn, 54)); 107 return 0; 108} 109 110int | 92{ 93 int error; 94 DECLARE_RQ; 95 96 ncp_init_request_s(conn, 28); 97 ncp_add_dword_lh(conn, connection); 98 99 if ((error = ncp_request(connid, 23, conn)) != 0) 100 return error; 101 bzero(target, sizeof(*target)); 102 target->object_id = ncp_reply_dword_hl(conn, 0); 103 target->object_type = ncp_reply_word_hl(conn, 4); 104 memcpy(target->object_name, ncp_reply_data(conn, 6), 105 sizeof(target->object_name)); 106 *login_time = ncp_nw_to_ctime((struct nw_time_buffer *)ncp_reply_data(conn, 54)); 107 return 0; 108} 109 110int |
111ncp_get_internet_address(int connid, u_int32_t connection, struct ipx_addr *target, 112 u_int8_t * conn_type) { | 111ncp_get_internet_address(NWCONN_HANDLE connid, u_int32_t connection, 112 struct ipx_addr *target, u_int8_t * conn_type) 113{ |
113 int error; 114 DECLARE_RQ; 115 116 ncp_init_request_s(conn, 26); 117 ncp_add_dword_lh(conn, connection); 118 error = ncp_request(connid, 23, conn); 119 if (error) return error; 120 bzero(target, sizeof(*target)); --- 173 unchanged lines hidden --- | 114 int error; 115 DECLARE_RQ; 116 117 ncp_init_request_s(conn, 26); 118 ncp_add_dword_lh(conn, connection); 119 error = ncp_request(connid, 23, conn); 120 if (error) return error; 121 bzero(target, sizeof(*target)); --- 173 unchanged lines hidden --- |