return 0;
}
+int knet_handle_pmtud_get(knet_handle_t knet_h,
+ unsigned int *link_mtu,
+ unsigned int *data_mtu)
+{
+ int savederrno = 0;
+
+ if (!knet_h) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ savederrno = pthread_rwlock_rdlock(&knet_h->list_rwlock);
+ if (savederrno) {
+ log_err(knet_h, KNET_SUB_HANDLE, "Unable to get write lock: %s",
+ strerror(savederrno));
+ errno = savederrno;
+ return -1;
+ }
+
+ *link_mtu = knet_h->link_mtu;
+ *data_mtu = knet_h->data_mtu;
+
+ pthread_rwlock_unlock(&knet_h->list_rwlock);
+
+ return 0;
+}
+
int knet_handle_crypto(knet_handle_t knet_h, struct knet_handle_crypto_cfg *knet_handle_crypto_cfg)
{
int savederrno = 0;
unsigned int link_mtu,
unsigned int data_mtu));
+/*
+ * knet_handle_pmtud_get
+ *
+ * knet_h - pointer to knet_handle_t
+ *
+ * link_mtu - pointer where to store link_mtu
+ * data_mtu - pointer where to store data_mtu (see above)
+ *
+ * knet_handle_pmtud_get returns:
+ *
+ * 0 on success
+ * -1 on error and errno is set.
+ */
+
+int knet_handle_pmtud_get(knet_handle_t knet_h,
+ unsigned int *link_mtu,
+ unsigned int *data_mtu);
+
/*
* knet_handle_crypto
*
size_t host_ids_entries = 0;
//int has_crypto = 0;
int logfd;
+ unsigned int link_mtu = 0, data_mtu = 0;
if (argc < 3) {
print_usage(argv[0]);
exit(EXIT_FAILURE);
}
+ if (knet_handle_pmtud_get(knet_h, &link_mtu, &data_mtu)) {
+ printf("Unable to get PMTUd current values\n");
+ exit(EXIT_FAILURE);
+ } else {
+ printf("Current PMTUd: link %u data %u\n", link_mtu, data_mtu);
+ }
+
if (knet_handle_enable_pmtud_notify(knet_h, pmtud_notify)) {
printf("Unable to install PMTUd notification callback\n");
exit(EXIT_FAILURE);