Changeset 5279:bb3ff1f2be28 in roaraudio
- Timestamp:
- 11/21/11 18:28:31 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
configure
r5277 r5279 1680 1680 test_func_defmake ROAR_HAVE_STRLCAT strlcat 'strlcat((char*)0, "", 0)' -- string.h 1681 1681 test_func_defmake ROAR_HAVE_NICE nice 'nice(0)' -- unistd.h 1682 test_func_defmake ROAR_HAVE_GETHOSTID gethostid 'gethostid()' -- unistd.h 1682 1683 test_func_defmake ROAR_HAVE_GETGID getgid 'getgid()' -- sys/types.h unistd.h 1683 1684 test_func_defmake ROAR_HAVE_GETUID getuid 'getuid()' -- sys/types.h unistd.h -
include/libroar/serverinfo.h
r4708 r5279 40 40 41 41 struct roar_server_info { 42 char * version; 43 char * location; 44 char * description; 45 char * contact; 46 char * serial; 47 char * address; 48 char * uiurl; 42 const char * version; 43 const char * location; 44 const char * description; 45 const char * contact; 46 const char * serial; 47 const char * address; 48 const char * uiurl; 49 const char * hostid; 50 const char * license; 49 51 struct { 50 c har * sysname;51 c har * release;52 c har * nodename;53 c har * machine;52 const char * sysname; 53 const char * release; 54 const char * nodename; 55 const char * machine; 54 56 } un; 55 57 }; -
include/roaraudio/proto.h
r5093 r5279 199 199 #define ROAR_ITST_UIURL 10 200 200 #define ROAR_ITST_HOSTID 11 201 #define ROAR_ITST_LICENSE 12 201 202 202 203 // IDs for diffrent clocks: -
libroar/serverinfo.c
r5270 r5279 39 39 int type; 40 40 size_t len; 41 c har * buf;41 const char * buf; 42 42 }; 43 43 … … 102 102 _add(ROAR_ITST_ADDRESS, address); 103 103 _add(ROAR_ITST_UIURL, uiurl); 104 _add(ROAR_ITST_LICENSE, license); 105 _add(ROAR_ITST_HOSTID, hostid); 104 106 _add(ROAR_ITST_UN_SYSNAME, un.sysname); 105 107 _add(ROAR_ITST_UN_RELEASE, un.release); … … 160 162 char * textpart; 161 163 char * textbuf; 162 c har ** tptr;164 const char ** tptr; 163 165 char * mesdata; 164 166 … … 272 274 _ck(ROAR_ITST_ADDRESS, address); 273 275 _ck(ROAR_ITST_UIURL, uiurl); 276 _ck(ROAR_ITST_HOSTID, hostid); 277 _ck(ROAR_ITST_LICENSE, license); 274 278 _ck(ROAR_ITST_UN_SYSNAME, un.sysname); 275 279 _ck(ROAR_ITST_UN_RELEASE, un.release); -
roarclients/roarctl.c
r5238 r5279 269 269 void server_info (struct roar_connection * con) { 270 270 struct roar_server_info * info = roar_server_info(con); 271 long hostid; 271 272 272 273 if ( info == NULL ) { … … 275 276 } 276 277 277 _pm(version, " version");278 _pm(location, " location");279 _pm(description, " description");280 _pm(contact, " contact");281 _pm(serial, " serial");282 _pm(address, " address");278 _pm(version, "Version"); 279 _pm(location, "Location"); 280 _pm(description, "Description"); 281 _pm(contact, "Contact"); 282 _pm(serial, "Serial"); 283 _pm(address, "Address"); 283 284 _pm(uiurl, "UI URL"); 285 _pm(license, "License"); 286 // _pm(hostid, "HostID"); 287 if ( info->hostid != NULL ) { 288 if ( sscanf(info->hostid, "0x%lx", &hostid) != 1 ) 289 hostid = 0; 290 291 if ( hostid ) { 292 printf("Server %-15s: %s (%li.%li.%li.%li)\n", "HostID", info->hostid, 293 ((hostid & 0x00FF0000UL) >> 16UL), 294 ((hostid & 0xFF000000UL) >> 24UL), 295 ((hostid & 0x000000FFUL) >> 0UL), 296 ((hostid & 0x0000FF00UL) >> 8UL) 297 ); 298 } else { 299 printf("Server %-15s: %s\n", "HostID", info->hostid); 300 } 301 } 284 302 _pm(un.sysname, "System sysname"); 285 303 _pm(un.release, "System release"); -
roard/include/roard.h
r5194 r5279 202 202 char * location; 203 203 char * description; 204 char * contact; 205 char * serial; 206 char * uiurl; 204 207 size_t jumbo_mtu; 205 208 int memlock_level; -
roard/req.c
r5216 r5279 750 750 struct roar_server_info info; 751 751 uint16_t * d16; 752 #ifdef ROAR_HAVE_GETHOSTID 753 long hostid; 754 char hostidbuf[64]; 755 #endif 752 756 753 757 if ( mes->datalen != 4 ) … … 771 775 } 772 776 777 info.license = "GPL-3.0"; 778 779 #ifdef ROAR_HAVE_GETHOSTID 780 hostid = gethostid(); 781 snprintf(hostidbuf, sizeof(hostidbuf), sizeof(long) == 8 ? "0x%.16lx" : "0x%.8lx", hostid); 782 info.hostid = hostidbuf; 783 #endif 784 773 785 if ( !!strcmp(g_config->location, CONF_DEF_STRING) ) 774 786 info.location = g_config->location; 775 787 776 788 if ( !!strcmp(g_config->description, CONF_DEF_STRING) ) 777 info.description = g_config->description; 789 info.description = g_config->description; 790 791 info.contact = g_config->contact; 792 info.serial = g_config->serial; 793 info.uiurl = g_config->uiurl; 778 794 779 795 #ifdef ROAR_HAVE_UNAME -
roard/roard.c
r5275 r5279 230 230 " --location LOC - Set lion readable location of server\n" 231 231 " --description DESC - Set lion readable description of server\n" 232 " --contact CONTACT - Set contact for this server\n" 233 " --serial SERIAL - Set serial for this device or server\n" 234 " (for embedded devices only)\n" 235 " --uiurl UIURL - Set URL for userinterface of this device or server\n" 236 " (for embedded devices only)\n" 232 237 #ifdef SUPPORT_PIDFILE 233 238 " --pidfile PIDFILE - Write a pidfile at PIDFILE\n" … … 513 518 g_config->location = CONF_DEF_STRING; 514 519 g_config->description = CONF_DEF_STRING; 520 g_config->contact = NULL; 521 g_config->serial = NULL; 522 g_config->uiurl = NULL; 515 523 516 524 g_config->memlock_level = -1; … … 1657 1665 _CKHAVEARGS(1); 1658 1666 g_config->description = argv[++i]; 1667 } else if ( strcmp(k, "--contact") == 0 ) { 1668 _CKHAVEARGS(1); 1669 g_config->contact = argv[++i]; 1670 } else if ( strcmp(k, "--serial") == 0 ) { 1671 _CKHAVEARGS(1); 1672 g_config->serial = argv[++i]; 1673 } else if ( strcmp(k, "--uiurl") == 0 ) { 1674 _CKHAVEARGS(1); 1675 g_config->uiurl = argv[++i]; 1659 1676 } else if ( strcmp(k, "--pidfile") == 0 ) { 1660 1677 _CKHAVEARGS(1);
Note: See TracChangeset
for help on using the changeset viewer.