int pcap_strcasecmp(const char *, const char *);
/*
- * Internal interface for pcap_parsesrcstr with the additional bit of
- * information regarding SSL support (rpcap:// vs rpcaps://)
+ * Internal interfaces for pcap_createsrcstr and pcap_parsesrcstr with
+ * the additional bit of information regarding SSL support (rpcap:// vs.
+ * rpcaps://).
*/
-int pcap_parsesrcstr_ex(const char *source, int *type, char *host, char *port,
- char *name, unsigned char *uses_ssl, char *errbuf);
+int pcap_createsrcstr_ex(char *, int, const char *, const char *,
+ const char *, unsigned char, char *);
+int pcap_parsesrcstr_ex(const char *, int *, char *, char *,
+ char *, unsigned char *, char *);
#ifdef YYDEBUG
extern int pcap_debug;
tmpstring[findalldevs_if.namelen] = 0;
/* Create the new device identifier */
- if (pcap_createsrcstr(tmpstring2, PCAP_SRC_IFREMOTE,
- host, port, tmpstring, errbuf) == -1)
+ if (pcap_createsrcstr_ex(tmpstring2, PCAP_SRC_IFREMOTE,
+ host, port, tmpstring, uses_ssl, errbuf) == -1)
goto error;
stringlen = strlen(tmpstring2);
}
int
-pcap_createsrcstr(char *source, int type, const char *host, const char *port,
- const char *name, char *errbuf)
+pcap_createsrcstr_ex(char *source, int type, const char *host, const char *port,
+ const char *name, unsigned char uses_ssl, char *errbuf)
{
switch (type) {
}
case PCAP_SRC_IFREMOTE:
- pcap_strlcpy(source, PCAP_SRC_IF_STRING, PCAP_BUF_SIZE);
+ pcap_strlcpy(source,
+ (uses_ssl ? "rpcaps://" : PCAP_SRC_IF_STRING),
+ PCAP_BUF_SIZE);
if (host != NULL && *host != '\0') {
if (strchr(host, ':') != NULL) {
/*
}
}
+
+int
+pcap_createsrcstr(char *source, int type, const char *host, const char *port,
+ const char *name, char *errbuf)
+{
+ return (pcap_createsrcstr_ex(source, type, host, port, name, 0, errbuf));
+}
+
int
pcap_parsesrcstr_ex(const char *source, int *type, char *host, char *port,
char *name, unsigned char *uses_ssl, char *errbuf)