Lines Matching defs:strp
1891 * \param strp possible start of transport; updated to point to
1897 get_transp(struct snmp_client *sc, const char **strp)
1903 p = strstr(*strp, trans_list[i]);
1904 if (p == *strp) {
1905 *strp += strlen(trans_list[i]);
1910 p = strstr(*strp, "::");
1911 if (p == *strp) {
1920 const char *ob = strchr(*strp, '[');
1925 seterr(sc, "unknown transport specifier '%.*s'", p - *strp, *strp);
1935 * \param strp possible start of community; updated to the point to
1938 * \return end of community; equals *strp if there is none; NULL if there
1942 get_comm(struct snmp_client *sc, const char **strp)
1944 const char *p = strrchr(*strp, '@');
1948 return (*strp);
1950 if (p - *strp > SNMP_COMMUNITY_MAXLEN) {
1952 p - *strp, *strp);
1956 *strp = p + 1;
1966 * \param strp possible start of IPv6 address (the '['); updated to point to
1969 * \return end of address (equals *strp + 1 if there is none) or NULL
1973 get_ipv6(struct snmp_client *sc, const char **strp)
1979 if (**strp != '[')
1980 return (*strp + 1);
1982 const char *p = *strp + 1;
1986 p - *strp, *strp);
1992 if (p - *strp > INET6_ADDRSTRLEN + IF_NAMESIZE) {
1993 seterr(sc, "IPv6 address too long '%.*s'", p - *strp, *strp);
1997 strncpy(str, *strp + 1, p - (*strp + 1));
1998 str[p - (*strp + 1)] = '\0';
2011 *strp = p + 1;
2021 * \param strp possible start of IPv4 address; updated to point to the
2024 * \return end of address (equals *strp if there is none) or NULL
2028 get_ipv4(struct snmp_client *sc, const char **strp)
2030 const char *p = *strp;
2035 if (p - *strp > INET_ADDRSTRLEN) {
2036 seterr(sc, "IPv4 address too long '%.*s'", p - *strp, *strp);
2039 if (*strp == p)
2040 return *strp;
2043 strncpy(str, *strp, p - *strp);
2044 str[p - *strp] = '\0';
2052 *strp = p;
2061 * \param strp possible start of hostname; updated to point to the next
2065 * \return end of address (equals *strp if there is none)
2068 get_host(struct snmp_client *sc __unused, const char **strp)
2070 const char *p = strrchr(*strp, ':');
2073 *strp += strlen(*strp);
2074 return (*strp);
2077 *strp = p;
2086 * \param strp possible start of port specification; if this points to a
2089 * \return end of port number (equals *strp if there is none); NULL
2093 get_port(struct snmp_client *sc, const char **strp)
2095 if (**strp != ':')
2096 return (*strp + 1);
2098 if ((*strp)[1] == '\0') {
2103 *strp += strlen(*strp);
2104 return (*strp);