#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <unistd.h>#include <arpa/inet.h>#include <fcntl.h>#include <sys/socket.h>#include <netinet/in.h>#include <pwd.h>#include "InfoStream.h"#include "memusage.h"#include "Lattice.h"#include "ComputeMsmMsa.h"#include "main.decl.h"#include "main.h"#include "main.def.h"Go to the source code of this file.
Classes | |
| class | main |
Defines | |
| #define | TBSOFT_TRACK_MAXLEN 1024 |
Functions | |
| int | send_dgram (const char *host_addr, int port, const char *buf, int buflen) |
| int | tbsoft_sendusage (const char *program, const char *versionnum, const char *platform, const char *numcpus, const char *miscinfo) |
Variables | |
| const char * | namd_build_date |
| const char * | namd_build_user |
| const char * | namd_build_machine |
|
|
Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved. |
|
||||||||||||||||||||
|
Definition at line 48 of file main.C. Referenced by tbsoft_sendusage(). 00048 {
00049 struct sockaddr_in addr;
00050 int sockfd;
00051
00052 #ifndef NOHOSTNAME
00053 if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
00054 return -1;
00055 }
00056
00057 memset(&addr, 0, sizeof(addr));
00058 addr.sin_family = AF_INET;
00059 addr.sin_port = htons(port);
00060 addr.sin_addr.s_addr = inet_addr(host_addr);
00061
00062 sendto(sockfd, buf, buflen, 0, (struct sockaddr *)&addr, sizeof(addr));
00063
00064 close(sockfd);
00065 #endif
00066
00067 return 0;
00068 }
|
|
||||||||||||||||||||||||
|
Definition at line 71 of file main.C. References iINFO(), iout, and send_dgram(). Referenced by main::main(). 00075 {
00076
00077 #ifndef NOHOSTNAME
00078 #ifdef TBSOFT_TRACK_HOST
00079 iout << iINFO
00080 << "Sending usage information to " << TBSOFT_TRACK_HOST
00081 << ":" << TBSOFT_TRACK_PORT << " via UDP. Sent data is:\n";
00082 #endif
00083
00084 char sendbuf[TBSOFT_TRACK_MAXLEN];
00085 char host[128];
00086 struct passwd *pw;
00087 char user[128];
00088
00089 memset(sendbuf, 0, sizeof(sendbuf));
00090
00091 gethostname(host, 128); host[127] = 0;
00092 pw = getpwuid(getuid());
00093 if ( pw && pw->pw_name ) {
00094 strncpy(user, pw->pw_name, 127); user[127] = 0;
00095 } else {
00096 sprintf(user,"%d",getuid());
00097 }
00098
00099 sprintf(sendbuf, "1 %s %s %s %s %s %s %s",
00100 program, versionnum, platform, numcpus, miscinfo, host, user);
00101 iout << iINFO << sendbuf << "\n" << endi;
00102 #ifdef TBSOFT_TRACK_HOST
00103 send_dgram(TBSOFT_TRACK_HOST, TBSOFT_TRACK_PORT, sendbuf, strlen(sendbuf));
00104 #endif
00105
00106 #endif
00107 return 0;
00108 }
|
|
|
Referenced by main::main(). |
|
|
Referenced by main::main(). |
|
|
Referenced by main::main(). |
1.3.9.1