Exemplo n.º 1
0
        public int Search(string base_entry,
                          SearchScope scope,
                          string filter,
                          string[]    attrs,
                          bool attrsonly,
                          TimeSpan timeOut,
                          int sizeLimit,
                          out LDAPMessage res)
        {
            // FIXME should expose client/server ctrls
            IntPtr  serverctrls = new IntPtr();
            IntPtr  clientctrls = new IntPtr();
            TimeVal tv          = TimeVal.FromTimeSpan(timeOut);
            IntPtr  native_res;
            int     rv;

            rv = ldap_search_ext_s(ld, base_entry, (int)scope, filter,
                                   attrs, attrsonly ? 1 : 0,
                                   serverctrls, clientctrls,
                                   ref tv, sizeLimit, out native_res);

            if (native_res != IntPtr.Zero)
            {
                res = new LDAPMessage(this, native_res);
            }
            else
            {
                res = null;
            }

            return(rv);
        }
Exemplo n.º 2
0
 static extern int ldap_search_ext_s(IntPtr ld,
                                     string base_entry,
                                     int scope,
                                     string filter,
                                     string[]   attrs,
                                     int attrsonly,
                                     IntPtr serverctrls,
                                     IntPtr clientctrls,
                                     ref TimeVal timeout,
                                     int sizelimit,
                                     out IntPtr res);
Exemplo n.º 3
0
		public static TimeVal FromTimeSpan (TimeSpan span) {
			TimeVal tv = new TimeVal();
			long nanoseconds;

			/* make sure we're dealing with a positive TimeSpan */
			span = span.Duration();

			nanoseconds = span.Ticks * 100;

			tv.tv_sec = (int)(nanoseconds / 1E+09);
			tv.tv_usec = (int)((nanoseconds % 1E+09) / 1000);

			return tv;
		}
Exemplo n.º 4
0
        public static TimeVal FromTimeSpan(TimeSpan span)
        {
            TimeVal tv = new TimeVal();
            long    nanoseconds;

            /* make sure we're dealing with a positive TimeSpan */
            span = span.Duration();

            nanoseconds = span.Ticks * 100;

            tv.tv_sec  = (int)(nanoseconds / 1E+09);
            tv.tv_usec = (int)((nanoseconds % 1E+09) / 1000);

            return(tv);
        }
Exemplo n.º 5
0
		static extern int ldap_search_ext_s (IntPtr	ld,
						     string	base_entry,
						     int	scope,
						     string	filter,
						     string[]	attrs,
						     int	attrsonly,
						     IntPtr	serverctrls,
						     IntPtr	clientctrls,
						     ref TimeVal timeout,
						     int	sizelimit,
						     out IntPtr	res);