Changeset 769:99136ec7d9d4 in freeDiameter for libfdproto
- Timestamp:
- Oct 26, 2011, 4:48:52 AM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/dictionary.c
r764 r769 1841 1841 All returned list must be accessed like this: 1842 1842 1843 for (li = sentinel->next; li =li->next; li != sentinel) {1843 for (li = sentinel->next; li != sentinel; li=li->next) { 1844 1844 struct dict_object * obj = li->o; 1845 1845 ... … … 1854 1854 You must resolve them separatly with dict_search. 1855 1855 1856 TYPE_BY_NAME : (parent = dictionary) returns list of types ordered by name 1857 ENUMVAL_BY_NAME : (parent = type object) return list of constants for this type ordered by name 1856 TYPE_BY_NAME : (parent = dictionary) returns list of types ordered by name (osstring order) 1857 ENUMVAL_BY_NAME : (parent = type object) return list of constants for this type ordered by name (osstring order) 1858 1858 ENUMVAL_BY_VALUE : (parent = type object) return list of constants for this type ordered by values 1859 AVP_BY_NAME : (parent = vendor object) return list of AVP for this vendor ordered by name 1859 AVP_BY_NAME : (parent = vendor object) return list of AVP for this vendor ordered by name (osstring order) 1860 1860 AVP_BY_CODE : (parent = vendor object) return list of AVP for this vendor ordered by code 1861 CMD_BY_NAME : (parent = dictionary) returns list of commands ordered by name 1861 CMD_BY_NAME : (parent = dictionary) returns list of commands ordered by name (osstring order) 1862 1862 CMD_BY_CODE_R : (parent = dictionary) returns list of commands ordered by code 1863 1863 RULE_BY_AVP_AND_PARENT: (parent = command or grouped AVP object) return list of rules for this object ordered by AVP vendor/code … … 1865 1865 All other criteria are rejected. 1866 1866 */ 1867 int fd_dict_getlistof(int criteria, void * parent, struct fd_list * sentinel)1867 int fd_dict_getlistof(int criteria, void * parent, struct fd_list ** sentinel) 1868 1868 { 1869 1869 struct dictionary * dict = parent; … … 1877 1877 case VENDOR_BY_ID: /* parent must be the dictionary */ 1878 1878 CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER); 1879 sentinel = &dict->dict_vendors.list[0];1879 *sentinel = &dict->dict_vendors.list[0]; 1880 1880 break; 1881 1881 1882 1882 case APPLICATION_BY_ID: /* parent must be the dictionary */ 1883 1883 CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER); 1884 sentinel = &dict->dict_applications.list[0];1884 *sentinel = &dict->dict_applications.list[0]; 1885 1885 break; 1886 1886 1887 1887 case TYPE_BY_NAME: /* parent must be the dictionary */ 1888 1888 CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER); 1889 sentinel = &dict->dict_types;1889 *sentinel = &dict->dict_types; 1890 1890 break; 1891 1891 1892 1892 case ENUMVAL_BY_NAME: /* parent must be a type object */ 1893 1893 CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_TYPE)); 1894 sentinel = &obj_parent->list[1];1894 *sentinel = &obj_parent->list[1]; 1895 1895 break; 1896 1896 1897 1897 case ENUMVAL_BY_VALUE: /* parent must be a type object */ 1898 1898 CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_TYPE)); 1899 sentinel = &obj_parent->list[2];1900 break; 1901 1902 case AVP_BY_NAME: /* parent must be a AVPobject */1903 CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_ AVP));1904 sentinel = &obj_parent->list[2];1905 break; 1906 1907 case AVP_BY_CODE: /* parent must be a AVPobject */1908 CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_ AVP));1909 sentinel = &obj_parent->list[1];1899 *sentinel = &obj_parent->list[2]; 1900 break; 1901 1902 case AVP_BY_NAME: /* parent must be a VENDOR object */ 1903 CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_VENDOR)); 1904 *sentinel = &obj_parent->list[2]; 1905 break; 1906 1907 case AVP_BY_CODE: /* parent must be a VENDOR object */ 1908 CHECK_PARAMS(verify_object(obj_parent) && (obj_parent->type == DICT_VENDOR)); 1909 *sentinel = &obj_parent->list[1]; 1910 1910 break; 1911 1911 1912 1912 case CMD_BY_NAME: /* parent must be the dictionary */ 1913 1913 CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER); 1914 sentinel = &dict->dict_cmd_name;1914 *sentinel = &dict->dict_cmd_name; 1915 1915 break; 1916 1916 1917 1917 case CMD_BY_CODE_R: /* parent must be the dictionary */ 1918 1918 CHECK_PARAMS(dict->dict_eyec == DICT_EYECATCHER); 1919 sentinel = &dict->dict_cmd_code;1919 *sentinel = &dict->dict_cmd_code; 1920 1920 break; 1921 1921 … … 1925 1925 ((obj_parent->type == DICT_AVP) 1926 1926 && (obj_parent->data.avp.avp_basetype == AVP_TYPE_GROUPED)) ); 1927 sentinel = &obj_parent->list[2];1927 *sentinel = &obj_parent->list[2]; 1928 1928 break; 1929 1929
Note: See TracChangeset
for help on using the changeset viewer.