| 715 | ************************************************************************/ |
| 716 | |
| 717 | static int |
| 718 | ng_string_parse(const struct ng_parse_type *type, |
| 719 | const char *s, int *off, const u_char *const start, |
| 720 | u_char *const buf, int *buflen) |
| 721 | { |
| 722 | char *sval; |
| 723 | int len; |
| 724 | int slen; |
| 725 | |
| 726 | if ((sval = ng_get_string_token(s, off, &len, &slen)) == NULL) |
| 727 | return (EINVAL); |
| 728 | *off += len; |
| 729 | bcopy(sval, buf, slen + 1); |
| 730 | free(sval, M_NETGRAPH_PARSE); |
| 731 | *buflen = slen + 1; |
| 732 | return (0); |
| 733 | } |
| 734 | |
| 735 | static int |
| 736 | ng_string_unparse(const struct ng_parse_type *type, |
nothing calls this directly
no test coverage detected