X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstream.c;h=eabace8a4ea72ad82fc54bc2657540ade09b99f4;hb=e09616c6c9d6d5f01e3400917b59764d263fea4a;hp=2f418c42ae22b36f160ba0d59d2ded3ee246bc77;hpb=f125905cdd3dc0339ad968c0a70128807884b400;p=openvswitch diff --git a/lib/stream.c b/lib/stream.c index 2f418c42..eabace8a 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -489,6 +489,25 @@ pstream_verify_name(const char *name) return pstream_lookup_class(name, &class); } +/* Returns 1 if the stream or pstream specified by 'name' needs periodic probes + * to verify connectivity. For [p]streams which need probes, it can take a + * long time to notice the connection has been dropped. Returns 0 if the + * stream or pstream does not need probes, and -1 if 'name' is not valid. */ +int +stream_or_pstream_needs_probes(const char *name) +{ + const struct pstream_class *pclass; + const struct stream_class *class; + + if (!stream_lookup_class(name, &class)) { + return class->needs_probes; + } else if (!pstream_lookup_class(name, &pclass)) { + return pclass->needs_probes; + } else { + return -1; + } +} + /* Attempts to start listening for remote stream connections. 'name' is a * connection name in the form "TYPE:ARGS", where TYPE is an passive stream * class's name and ARGS are stream class-specific.