Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Add wrapper for mk::clear_nameservers()
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Dec 13, 2015
1 parent c83e827 commit 6216504
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions java/io/github/measurement_kit/jni/DnsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
*/
public class DnsApi {

/**
* Clear all configured nameservers.
*/
public static native void clearNameServers();

/**
* Count number of registered nameservers
* @return Number of registered nameservers
Expand Down
10 changes: 10 additions & 0 deletions jni/dns_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
#include "common.hpp"
#include "io_github_measurement_kit_jni_DnsApi.h"

JNIEXPORT void JNICALL
Java_io_github_measurement_1kit_jni_DnsApi_clearNameServers
(JNIEnv * /*env*/, jclass /*clazz*/) {
try {
mk::clear_nameservers();
} catch (...) {
// XXX suppress
}
}

JNIEXPORT jint JNICALL
Java_io_github_measurement_1kit_jni_DnsApi_countNameServers
(JNIEnv * /*env*/, jclass /*clazz*/) {
Expand Down

0 comments on commit 6216504

Please sign in to comment.