diff options
| author | Theodore Tso <tytso@mit.edu> | 1991-03-28 17:50:46 +0000 |
|---|---|---|
| committer | Theodore Tso <tytso@mit.edu> | 1991-03-28 17:50:46 +0000 |
| commit | 7fc4742c314b8164fd61ce93036ace02ea967775 (patch) | |
| tree | 735ea9685a3e97b79358f59ccf0d63b22904890e /src/lib/krb5/os/write_msg.c | |
| parent | 4baad0c14d21eb513f5373c6c3a7ee85b3e2137e (diff) | |
| download | krb5-7fc4742c314b8164fd61ce93036ace02ea967775.tar.gz krb5-7fc4742c314b8164fd61ce93036ace02ea967775.tar.xz krb5-7fc4742c314b8164fd61ce93036ace02ea967775.zip | |
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1954 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/os/write_msg.c')
| -rw-r--r-- | src/lib/krb5/os/write_msg.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/lib/krb5/os/write_msg.c b/src/lib/krb5/os/write_msg.c new file mode 100644 index 0000000000..61ac2d8c79 --- /dev/null +++ b/src/lib/krb5/os/write_msg.c @@ -0,0 +1,48 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1991 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * For copying and distribution information, please see the file + * <krb5/copyright.h>. + * + * convenience sendauth/recvauth functions + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_sendauth_c [] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/krb5.h> +#include <krb5/los-proto.h> +#include <com_err.h> +#include <errno.h> + +#include <stdio.h> +#include <string.h> +#include <netinet/in.h> + +krb5_error_code +krb5_write_message(fdp, outbuf) + krb5_pointer fdp; + krb5_data *outbuf; +{ + krb5_int32 len; + int fd = *( (int *) fdp); + + len = htonl(outbuf->length); + if (krb5_net_write(fd, (char *)&len, 4) < 0) { + return(errno); + } + if (len && (krb5_net_write(fd, outbuf->data, outbuf->length) < 0)) { + return(errno); + } + return(0); +} + + + + |
