From 84daf66dffd990c99eb0205e009ad2fe38e80520 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 31 Aug 1998 03:57:49 +0000 Subject: [PATCH] Implement primitive to map socket port numbers from host to network order. --- v7/src/microcode/os2sock.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/v7/src/microcode/os2sock.c b/v7/src/microcode/os2sock.c index 72ba016d1..a133884e6 100644 --- a/v7/src/microcode/os2sock.c +++ b/v7/src/microcode/os2sock.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: os2sock.c,v 1.6 1997/11/12 22:14:09 cph Exp $ +$Id: os2sock.c,v 1.7 1998/08/31 03:57:49 cph Exp $ -Copyright (c) 1990-97 Massachusetts Institute of Technology +Copyright (c) 1990-98 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -137,6 +137,12 @@ OS_get_service_by_name (const char * service_name, const char * protocol_name) return ((entry == 0) ? (-1) : (entry -> s_port)); } +unsigned short +OS_get_service_by_number (const unsigned short port_number) +{ + return (htons (port_number)); +} + unsigned int OS_host_address_length (void) { -- 2.25.1