Changeset 18058 for trunk/FACT++/dim/src/webDid
- Timestamp:
- 01/03/15 18:26:23 (10 years ago)
- Location:
- trunk/FACT++/dim/src/webDid
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/src/webDid/webDid.c
r15282 r18058 46 46 CURR_SERVICE *Curr_service_head = (CURR_SERVICE *)0; 47 47 48 typedef struct objstate{ 49 char name[MAX_NAME]; 50 char state[512]; 51 int sid; 52 int mode_index; 53 void *browserp; 54 }OBJSTATE; 55 /* 56 typedef struct domainitem{ 57 char name[MAX_NAME]; 58 OBJSTATE objs[1]; 59 }CURR_SMIDOMAIN; 60 */ 48 61 typedef struct bitem{ 49 62 struct bitem *next; … … 53 66 time_t last_updated; 54 67 time_t last_polled; 68 time_t last_changed; 55 69 int conn_id; 56 70 int n_services; … … 60 74 char *JSONBuffer; 61 75 int JSONBufferSize; 76 char *JSONSmiBuffer; 77 int JSONSmiBufferSize; 62 78 char pattern[256]; 63 79 char curr_command[MAX_NAME]; 64 80 char *service_format_ptr; 81 int isSMI; 82 int n_domains; 83 char curr_smidomain[MAX_NAME]; 84 int curr_smidomain_size; 85 int curr_smidomain_nobjs; 86 OBJSTATE *smidomainp; 65 87 }BROWSER; 66 88 BROWSER *Browser_head = (BROWSER *)0; … … 69 91 int JSONBufferSize = 0; 70 92 char JSONHeader[256] = {'\0'}; 93 char JSONSmiHeader[256] = {'\0'}; 94 95 char *JSONSmiBuffer = 0; 96 int JSONSmiBufferSize = 0; 71 97 72 98 int First_time = 1; … … 80 106 int N_services = 0; 81 107 static char no_link = -1; 108 static char no_link_str[5] = "DEAD"; 82 109 int no_link_int = -1; 83 110 FILE *fptr; … … 424 451 NODE *nodep; 425 452 SERVER *servp; 426 char *ptr ;453 char *ptr = 0; 427 454 BROWSER *browserp; 428 455 char *prepareJSONServiceList(); … … 441 468 { 442 469 ptr = prepareJSONServiceList(servp, node, pid, browserp); 470 } 471 } 472 return ptr; 473 } 474 475 void got_update_smi_objects(BROWSER **tag, char *buffer, int *size) 476 { 477 BROWSER *browserp; 478 479 if(size){} 480 browserp = (BROWSER *)*tag; 481 if(browserp->service_format_ptr) 482 free(browserp->service_format_ptr); 483 browserp->service_format_ptr = (char *)malloc(strlen(buffer)+1); 484 strcpy(browserp->service_format_ptr, buffer); 485 } 486 487 char *update_smi_objects(char *node, char *server, int pid, int browser) 488 { 489 char str[MAX_NAME]; 490 NODE *nodep; 491 SERVER *servp; 492 char *ptr = 0; 493 BROWSER *browserp; 494 char *prepareJSONSmiObjectList(); 495 BROWSER *create_browser(); 496 497 if(!(browserp = find_browser(browser))) 498 { 499 browserp = create_browser(browser); 500 browserp->isSMI = 1; 501 } 502 if(server){} 503 sprintf(str,"%s/SERVICE_LIST",server); 504 dic_info_service(str,ONCE_ONLY,20,0,0, 505 got_update_smi_objects,(dim_long)browserp,"None",5); 506 if((nodep = find_node(node))) 507 { 508 if((servp = find_server(nodep, pid))) 509 { 510 ptr = prepareJSONSmiObjectList(servp, node, pid, browserp); 443 511 } 444 512 } … … 604 672 browserp = (BROWSER *)malloc(sizeof(BROWSER)); 605 673 browserp->id = id; 606 674 browserp->last_subscribed = 0; 607 675 browserp->last_updated = 0; 608 676 browserp->last_polled = 0; 677 browserp->last_changed = 0; 609 678 browserp->n_nodes = 0; 610 679 browserp->n_servers = 0; … … 613 682 browserp->JSONBuffer = 0; 614 683 browserp->JSONBufferSize = 0; 684 browserp->JSONSmiBuffer = 0; 685 browserp->JSONSmiBufferSize = 0; 615 686 browserp->pattern[0] = '\0'; 616 687 browserp->service_format_ptr = 0; 617 688 browserp->curr_command[0] = '\0'; 689 browserp->curr_smidomain[0] = '\0'; 690 browserp->smidomainp = 0; 618 691 sll_insert_queue((SLL *)Browser_head,(SLL *)browserp); 619 692 dtq_start_timer(10, check_browser, browserp); … … 744 817 } 745 818 } 819 } 820 } 821 if(browserp->isSMI) 822 { 823 if((browserp->last_changed >= browserp->last_polled) || (force)) 824 { 825 service_changed = 1; 746 826 } 747 827 } … … 1177 1257 if(isprint(asc[j])) 1178 1258 { 1179 sprintf(str,"%c",asc[j]); 1259 if(asc[j] == ' ') 1260 sprintf(str," "); 1261 else if(asc[j] == '<') 1262 sprintf(str,"<"); 1263 else if(asc[j] == '>') 1264 sprintf(str,">"); 1265 else if(asc[j] == '&') 1266 sprintf(str,"&"); 1267 else 1268 sprintf(str,"%c",asc[j]); 1180 1269 strcat(tmp,str); 1181 1270 } … … 1345 1434 } 1346 1435 1347 char *getJSONHeader() 1436 char *getJSONSmiBuffer(char *node, int browser) 1437 { 1438 BROWSER *browserp; 1439 int prepareJSONSmiTree(); 1440 1441 if(!(browserp = find_browser(browser))) 1442 { 1443 browserp = create_browser(browser); 1444 browserp->isSMI = 1; 1445 strcpy(browserp->pattern,"SMI/"); 1446 } 1447 if(browser) 1448 { 1449 if((browserp = find_browser(browser))) 1450 { 1451 if(browserp->pattern[0] != '\0') 1452 { 1453 prepareJSONSmiTree(node, browserp); 1454 return(browserp->JSONSmiBuffer); 1455 } 1456 // browserp->n_services = 0; 1457 // browserp->n_servers = 0; 1458 // browserp->n_nodes = 0; 1459 } 1460 } 1461 prepareJSONSmiTree(node, 0); 1462 return(JSONSmiBuffer); 1463 } 1464 1465 char *getJSONHeader(int isSMI) 1348 1466 { 1349 1467 int prepareJSONHeader(); 1350 1468 1469 if(isSMI){} 1351 1470 if(JSONHeader[0] == '\0') 1352 1471 prepareJSONHeader(); … … 1526 1645 printf(" Nodes&Servers %s\n",browserp->JSONBuffer); 1527 1646 */ 1647 return(1); 1648 } 1649 1650 int prepareJSONSmiTree(char *node, BROWSER *browserp) 1651 { 1652 char *ptr; 1653 NODE *nodep; 1654 SERVER *servp; 1655 char str[256], aux[128]; 1656 int selective = 0; 1657 int n_nodes, tot_n_nodes; 1658 int n_servers, tot_n_servers; 1659 int ret, n_found = 0; 1660 char pattern[256] = {'\0'}; 1661 char *sptr; 1662 1663 if(browserp) 1664 { 1665 if(browserp->pattern[0] != '\0') 1666 { 1667 selective = 1; 1668 strcpy(pattern, browserp->pattern); 1669 } 1670 // else 1671 // return(0); 1672 } 1673 // selective = 1; 1674 // strcpy(pattern,"SMI/*"); 1675 if(!selective) 1676 { 1677 if(JSONSmiBufferSize == 0) 1678 { 1679 JSONSmiBuffer = malloc((size_t)(N_nodes*128+N_servers*128)); 1680 } 1681 else if (JSONSmiBufferSize < N_nodes*128+N_servers*128) 1682 { 1683 free(JSONSmiBuffer); 1684 JSONSmiBuffer = malloc((size_t)(N_nodes*128+N_servers*128)); 1685 } 1686 ptr = JSONSmiBuffer; 1687 } 1688 else 1689 { 1690 if(browserp->JSONSmiBufferSize == 0) 1691 { 1692 browserp->JSONSmiBuffer = malloc((size_t)(N_nodes*128+N_servers*128)); 1693 } 1694 else if (browserp->JSONSmiBufferSize < N_nodes*128+N_servers*128) 1695 { 1696 free(browserp->JSONSmiBuffer); 1697 browserp->JSONSmiBuffer = malloc((size_t)(N_nodes*128+N_servers*128)); 1698 } 1699 ptr = browserp->JSONSmiBuffer; 1700 } 1701 *ptr = '\0'; 1702 if(!strcmp(node, "src")) 1703 { 1704 ptr = addJSONStart(ptr); 1705 ptr = addJSONNodeStart(ptr,"children"); 1706 sprintf(str,"text: \"%s\", id: \"Nodes\", expanded: false", Title); 1707 ptr = addJSONChildStart(ptr,str,1); 1708 ptr = addJSONNodeStart(ptr,"children"); 1709 nodep = Node_head; 1710 tot_n_nodes = 0; 1711 while( (nodep = (NODE *)sll_get_next((SLL *)nodep)) ) 1712 { 1713 nodep->match = 1; 1714 if(selective) 1715 { 1716 if(!(ret = find_service_pattern(nodep, 0, pattern, &tot_n_servers))) 1717 { 1718 nodep->match = 0; 1719 continue; 1720 } 1721 else 1722 { 1723 n_found += ret; 1724 } 1725 } 1726 tot_n_nodes++; 1727 } 1728 n_nodes = 0; 1729 nodep = Node_head; 1730 while( (nodep = (NODE *)sll_get_next((SLL *)nodep)) ) 1731 { 1732 if(!nodep->match) 1733 continue; 1734 getNodeLabel(nodep->name, aux); 1735 sprintf(str,"text: \"%s\", id: \"%s\", qtip: \"%s\"", 1736 aux, nodep->name, nodep->name); 1737 ptr = addJSONChildStart(ptr,str,0); 1738 n_nodes++; 1739 if(WebDID_Debug) 1740 printf("adding %s %d %d\n",nodep->name, n_nodes, tot_n_nodes); 1741 if(n_nodes < tot_n_nodes) 1742 ptr = addJSONChildEnd(ptr,1); 1743 else 1744 ptr = addJSONChildEnd(ptr,0); 1745 } 1746 ptr = addJSONNodeEnd(ptr); 1747 ptr = addJSONChildEnd(ptr,0); 1748 ptr = addJSONNodeEnd(ptr); 1749 ptr = addJSONEnd(ptr); 1750 if(selective) 1751 { 1752 browserp->n_services = n_found; 1753 browserp->n_servers = tot_n_servers; 1754 browserp->n_nodes = tot_n_nodes; 1755 } 1756 } 1757 else 1758 { 1759 if((nodep = find_node(node))) 1760 { 1761 ptr = addJSONStart(ptr); 1762 ptr = addJSONNodeStart(ptr,"children"); 1763 servp = nodep->server_head; 1764 tot_n_servers = 0; 1765 while( (servp = (SERVER *)sll_get_next((SLL *)servp)) ) 1766 { 1767 servp->match = 1; 1768 if(servp->busy != 1) 1769 { 1770 servp->match = 0; 1771 continue; 1772 } 1773 if(selective) 1774 { 1775 if(!(ret = find_service_pattern(nodep, servp, pattern, 0))) 1776 { 1777 servp->match = 0; 1778 continue; 1779 } 1780 else 1781 { 1782 n_found += ret; 1783 } 1784 } 1785 tot_n_servers++; 1786 } 1787 n_servers = 0; 1788 servp = nodep->server_head; 1789 while( (servp = (SERVER *)sll_get_next((SLL *)servp)) ) 1790 { 1791 if(!servp->match) 1792 continue; 1793 strcpy(aux, servp->name); 1794 sptr = strstr(aux,"_SMI"); 1795 if(sptr) 1796 *sptr = '\0'; 1797 sprintf(str,"text: \"%s\", id: \"%d\", leaf: true, icon: \"server.png\", name: \"%s\"",aux, servp->server.pid, servp->name); 1798 ptr = addJSONChildStart(ptr,str,0); 1799 n_servers++; 1800 if(n_servers < tot_n_servers) 1801 ptr = addJSONChildEnd(ptr,1); 1802 else 1803 ptr = addJSONChildEnd(ptr,0); 1804 } 1805 ptr = addJSONNodeEnd(ptr); 1806 ptr = addJSONEnd(ptr); 1807 } 1808 } 1809 /* 1810 if(!selective) 1811 printf(" Nodes&Servers %s\n",JSONBuffer); 1812 else 1813 printf(" Nodes&Servers %s\n",browserp->JSONBuffer); 1814 */ 1815 printf("%s\n",browserp->JSONSmiBuffer); 1528 1816 return(1); 1529 1817 } … … 1566 1854 if(JSONServicesSize == 0) 1567 1855 { 1568 JSONServices = malloc((size_t)(n_services*256)); 1856 JSONServicesSize = n_services*256; 1857 JSONServices = malloc((size_t)JSONServicesSize); 1569 1858 } 1570 1859 else if (JSONServicesSize < n_services*256) 1571 1860 { 1572 1861 free(JSONServices); 1573 JSONServices = malloc((size_t)(n_services*256)); 1862 JSONServicesSize = n_services*256; 1863 JSONServices = malloc((size_t)JSONServicesSize); 1574 1864 } 1575 1865 if(browserp) … … 1626 1916 ptr = addJSONEnd(ptr); 1627 1917 return JSONServices; 1918 } 1919 1920 char *JSONSmiServices = 0; 1921 int JSONSmiServicesSize = 0; 1922 1923 char *prepareJSONSmiObjectList(SERVER *servp, char *node, int pid, BROWSER *browserp) 1924 { 1925 DNS_SERVICE_INFO *servicep; 1926 char *ptr; 1927 int n_services, i; 1928 char str[512], type_str[512]; 1929 int selective = 0; 1930 int n_found = 0, n, mode_index; 1931 char aux[512], *sptr, state[512], *stptr; 1932 OBJSTATE *smidomainp; 1933 int findSmiServices(); 1934 1935 printf("prepareJSONSmiObjectList name %s\n", servp->name); 1936 servicep = servp->service_ptr; 1937 n_services = servp->server.n_services; 1938 if(JSONSmiServicesSize == 0) 1939 { 1940 JSONSmiServicesSize = n_services*512; 1941 JSONSmiServices = malloc((size_t)JSONSmiServicesSize); 1942 } 1943 else if (JSONSmiServicesSize < n_services*512) 1944 { 1945 free(JSONSmiServices); 1946 JSONSmiServicesSize = n_services*512; 1947 JSONSmiServices = malloc((size_t)JSONSmiServicesSize); 1948 } 1949 if(browserp) 1950 { 1951 if(browserp->pattern[0] != '\0') 1952 selective = 1; 1953 } 1954 n_found = n_services; 1955 /* 1956 if(selective) 1957 { 1958 n_found = find_server_service_pattern(servp, browserp->pattern); 1959 } 1960 */ 1961 1962 n_found = findSmiServices(browserp, servp); 1963 smidomainp = browserp->smidomainp; 1964 1965 printf("prepareJSONSmiObjectList1 name %s\n", servp->name); 1966 1967 1968 ptr = JSONSmiServices; 1969 *ptr = '\0'; 1970 ptr = addJSONStart(ptr); 1971 ptr = addJSONNodeStart(ptr,"children"); 1972 /* 1973 if(selective) 1974 sprintf(str,"name: \"%s (%d/%d services, pid %d)\"",servp->name, n_found, n_services, servp->server.pid); 1975 else 1976 sprintf(str,"name: \"%s (%d services, pid %d)\"",servp->name, n_services, servp->server.pid); 1977 */ 1978 sprintf(str,"name: \"%s (%d objects, pid %d)\"",servp->name, n_found, servp->server.pid); 1979 ptr = addJSONChildStart(ptr,str,1); 1980 ptr = addJSONNodeStart(ptr,"children"); 1981 servicep = servp->service_ptr; 1982 n = 0; 1983 for(i = 0; i < n_services; i++) 1984 { 1985 /* 1986 printf("Service type = %d\n",servicep->type); 1987 */ 1988 printf("prepareJSONSmiObjectList2 obj name %s\n", servicep->name); 1989 if((!selective) || (strstr(servicep->name, browserp->pattern))) 1990 { 1991 /* 1992 if(servicep->type == 1) 1993 { 1994 sprintf(type_str,"%d@%s|%s|CMD", pid, node, servicep->name); 1995 sprintf(str,"name: \"%s\", id: \"%s\", leaf: true, icon: \"leaf_cmd.gif\"",servicep->name, type_str); 1996 } 1997 else 1998 { 1999 sprintf(type_str,"%d@%s|%s", pid, node, servicep->name); 2000 sprintf(str,"name: \"%s\", state: \"RUNNING\", id: \"%s\", leaf: true",servicep->name, type_str); 2001 } 2002 */ 2003 if(servicep->status == 2) 2004 { 2005 sprintf(type_str,"%d@%s|%s", pid, node, servicep->name); 2006 strcpy(aux, servicep->name); 2007 sptr = strchr(aux,'/'); 2008 if(sptr) 2009 { 2010 sptr++; 2011 sptr = strchr(sptr,'/'); 2012 if(sptr) 2013 sptr++; 2014 } 2015 strcpy(state, smidomainp[i].state); 2016 stptr = strchr(state,'/'); 2017 if(stptr) 2018 { 2019 *stptr = '\0'; 2020 } 2021 mode_index = smidomainp[i].mode_index; 2022 // sprintf(str,"name: \"%s\", state: \"%s\", id: \"%s\", leaf: true, fname: \"%s\"",sptr, state, type_str, servicep->name); 2023 sprintf(str,"name: \"%s\", state: \"%s\", mode: \"%s\",id: \"%s\", leaf: true, fname: \"%s\"", 2024 sptr, state, smidomainp[mode_index].state, type_str, servicep->name); 2025 2026 ptr = addJSONChildStart(ptr,str,0); 2027 n++; 2028 if(n < n_found) 2029 ptr = addJSONChildEnd(ptr,1); 2030 else 2031 ptr = addJSONChildEnd(ptr,0); 2032 } 2033 } 2034 servicep++; 2035 } 2036 ptr = addJSONNodeEnd(ptr); 2037 ptr = addJSONChildEnd(ptr,0); 2038 ptr = addJSONNodeEnd(ptr); 2039 ptr = addJSONEnd(ptr); 2040 printf("%s\n",JSONSmiServices); 2041 return JSONSmiServices; 2042 } 2043 2044 void update_smi_state(OBJSTATE **tag, char *data, int *size) 2045 { 2046 OBJSTATE *servicep; 2047 time_t tsecs; 2048 2049 if(*size){} 2050 servicep = *tag; 2051 2052 if(strcmp(servicep->state, data)) 2053 { 2054 strcpy(servicep->state, data); 2055 tsecs = time((time_t *)0); 2056 ((BROWSER *)(servicep->browserp))->last_changed = tsecs; 2057 } 2058 //printf("SMI State %s %s %08x\n", servicep->name, servicep->state, (unsigned int)servicep); 2059 } 2060 2061 int findSmiServices(BROWSER *browserp, SERVER *servp) 2062 { 2063 DNS_SERVICE_INFO *servicep; 2064 int n_services, i, index; 2065 int n_found = 0, sid; 2066 int checkSmiObjName(); 2067 int findSmiModeObj(); 2068 2069 n_services = servp->server.n_services; 2070 if(strcmp(browserp->curr_smidomain,servp->name)) 2071 { 2072 if(browserp->curr_smidomain[0] != '\0') 2073 { 2074 // unsubscribe; free 2075 for(i = 0; i < browserp->curr_smidomain_size; i++) 2076 { 2077 if(browserp->smidomainp[i].sid) 2078 dic_release_service(browserp->smidomainp[i].sid); 2079 } 2080 free(browserp->smidomainp); 2081 browserp->curr_smidomain[0] = '\0'; 2082 browserp->curr_smidomain_size = 0; 2083 } 2084 strcpy(browserp->curr_smidomain, servp->name); 2085 browserp->smidomainp = malloc(n_services * sizeof(OBJSTATE)); 2086 browserp->curr_smidomain_size = n_services; 2087 } 2088 else 2089 return browserp->curr_smidomain_nobjs; 2090 servicep = servp->service_ptr; 2091 for(i = 0; i < n_services; i++) 2092 { 2093 browserp->smidomainp[i].sid = 0; 2094 browserp->smidomainp[i].state[0] = '\0'; 2095 if(checkSmiObjName(servicep)) 2096 { 2097 strcpy(browserp->smidomainp[i].name, servicep->name); 2098 // strcpy(browserp->smidomainp[i].state, ""); 2099 browserp->smidomainp[i].browserp = browserp; 2100 //printf("address %s %08x\n",browserp->smidomainp[i].name, (unsigned int)&(browserp->smidomainp[i])); 2101 sid = dic_info_service(servicep->name,MONITORED,0,0,0,update_smi_state, &(browserp->smidomainp[i]), 2102 no_link_str, 5); 2103 browserp->smidomainp[i].sid = sid; 2104 if(servicep->status == 2) 2105 n_found++; 2106 } 2107 servicep++; 2108 } 2109 servicep = servp->service_ptr; 2110 for(i = 0; i < n_services; i++) 2111 { 2112 if(servicep->status == 2) 2113 { 2114 index = findSmiModeObj(servp->service_ptr, n_services, servicep->name); 2115 browserp->smidomainp[i].mode_index = index; 2116 } 2117 servicep++; 2118 } 2119 browserp->curr_smidomain_nobjs = n_found; 2120 return n_found; 2121 } 2122 2123 int findSmiModeObj(DNS_SERVICE_INFO *serviceptr, int n_services, char *name) 2124 { 2125 int i; 2126 DNS_SERVICE_INFO *servicep; 2127 char mode_name[256], *ptr, *ptr1, *ptr2; 2128 2129 servicep = serviceptr; 2130 strcpy(mode_name, name); 2131 ptr1 = mode_name; 2132 if((ptr = strstr(mode_name,"::"))) 2133 { 2134 *ptr = '\0'; 2135 ptr2 = ptr1; 2136 while((ptr1 = strchr(ptr1,'/'))) 2137 { 2138 ptr1++; 2139 ptr2 = ptr1; 2140 } 2141 if(strcmp(ptr2, ptr+2)) 2142 *ptr = ':'; 2143 } 2144 strcat(mode_name,"_FWM"); 2145 printf("Find SMI Mode %s %s\n",name, mode_name); 2146 for(i = 0; i < n_services; i++) 2147 { 2148 if(servicep->status == 3) 2149 { 2150 if(!strcmp(servicep->name, mode_name)) 2151 { 2152 printf("Find SMI Mode index %s %s %d\n",mode_name, servicep->name, i); 2153 return i; 2154 } 2155 } 2156 servicep++; 2157 } 2158 return 0; 2159 } 2160 2161 int checkSmiObjName(DNS_SERVICE_INFO *servicep) 2162 { 2163 int ismode = 0, ret = 0; 2164 char *name; 2165 int matchString(); 2166 2167 name = servicep->name; 2168 if(matchString(name,"SMI/*")) 2169 { 2170 ret = 1; 2171 if(matchString(name,"*&ALLOC*")) 2172 ret = 0; 2173 else if(matchString(name,"*/ACTIONS&PARS")) 2174 ret = 0; 2175 else if(matchString(name,"*/BUSY")) 2176 ret = 0; 2177 else if(matchString(name,"*/CMD")) 2178 ret = 0; 2179 else if(matchString(name,"*/OBJECTSET_LIST")) 2180 ret = 0; 2181 else if(matchString(name,"*/OBJECT_LIST")) 2182 ret = 0; 2183 else if(matchString(name,"*/SMI_VERSION_NUMBER")) 2184 ret = 0; 2185 else if(matchString(name,"*/SET/*")) 2186 ret = 0; 2187 // If JCOP framework 2188 else if(matchString(name,"*_FWDM")) 2189 ret = 0; 2190 else if(matchString(name,"*_FWCNM")) 2191 ret = 0; 2192 else if(matchString(name,"*_FWM")) 2193 { 2194 ismode = 1; 2195 if(matchString(name,"*::*")) 2196 ret = 0; 2197 } 2198 } 2199 if(ret) 2200 { 2201 if(ismode) 2202 servicep->status = 3; 2203 else 2204 servicep->status = 2; 2205 } 2206 return ret; 1628 2207 } 1629 2208 -
trunk/FACT++/dim/src/webDid/webServer.c
r15282 r18058 257 257 if(type == 0) 258 258 { 259 ptr = getJSONHeader( );259 ptr = getJSONHeader(0); 260 260 } 261 261 else if(type == 1) … … 350 350 char node[128], server[256], service[256]; 351 351 int pid, ret, req, browser, force; 352 extern char *update_services() ;352 extern char *update_services(), *update_smi_objects(); 353 353 extern char *update_service_data(); 354 354 extern char *getJSONHeader(); 355 extern char *getJSONBuffer() ;355 extern char *getJSONBuffer(), *getJSONSmiBuffer(); 356 356 char datatype[128]; 357 357 char *conv_buffer; … … 361 361 if(type == 0) 362 362 { 363 ptr = getJSONHeader( );363 ptr = getJSONHeader(1); 364 364 } 365 365 else if(type == 1) 366 366 { 367 367 ret = getNodeParameters(conv_buffer, node, &browser); 368 ptr = getJSON Buffer(node, browser);368 ptr = getJSONSmiBuffer(node, browser); 369 369 } 370 370 else if(type == 2) … … 378 378 else 379 379 { 380 ptr = update_s ervices(node, server, pid, browser);380 ptr = update_smi_objects(node, server, pid, browser); 381 381 } 382 382 } … … 550 550 return; 551 551 } 552 else if(!strncmp(&buffer[5],"smiObjects",11)) 552 else if(!strncmp(&buffer[5],"smiData",7)) 553 { 554 sendSmiData(conn_id, &buffer[5], 1); 555 return; 556 } 557 else if(!strncmp(&buffer[5],"smiObjects",10)) 553 558 { 554 559 sendSmiData(conn_id, &buffer[5], 2);
Note:
See TracChangeset
for help on using the changeset viewer.