⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netdfs.java

📁 实现网上邻居需要的jar库;可以使用库中的接口实现文件共享的功能
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package jcifs.dcerpc.msrpc;

import jcifs.dcerpc.*;
import jcifs.dcerpc.ndr.*;

public class netdfs {

    public static String getSyntax() {
        return "4fc742e0-4a10-11cf-8273-00aa004ae673:3.0";
    }

    public static final int DFS_VOLUME_FLAVOR_STANDALONE = 0x100;
    public static final int DFS_VOLUME_FLAVOR_AD_BLOB = 0x200;
    public static final int DFS_STORAGE_STATE_OFFLINE = 0x0001;
    public static final int DFS_STORAGE_STATE_ONLINE = 0x0002;
    public static final int DFS_STORAGE_STATE_ACTIVE = 0x0004;
    public static class DfsInfo1 extends NdrObject {

        public String entry_path;

        public void encode(NdrBuffer _dst) throws NdrException {
            _dst.align(4);
            _dst.enc_ndr_referent(entry_path, 1);

            if (entry_path != null) {
                _dst = _dst.deferred;
                _dst.enc_ndr_string(entry_path);

            }
        }
        public void decode(NdrBuffer _src) throws NdrException {
            _src.align(4);
            int _entry_pathp = _src.dec_ndr_long();

            if (_entry_pathp != 0) {
                _src = _src.deferred;
                entry_path = _src.dec_ndr_string();

            }
        }
    }
    public static class DfsEnumArray1 extends NdrObject {

        public int count;
        public DfsInfo1[] s;

        public void encode(NdrBuffer _dst) throws NdrException {
            _dst.align(4);
            _dst.enc_ndr_long(count);
            _dst.enc_ndr_referent(s, 1);

            if (s != null) {
                _dst = _dst.deferred;
                int _ss = count;
                _dst.enc_ndr_long(_ss);
                int _si = _dst.index;
                _dst.advance(4 * _ss);

                _dst = _dst.derive(_si);
                for (int _i = 0; _i < _ss; _i++) {
                    s[_i].encode(_dst);
                }
            }
        }
        public void decode(NdrBuffer _src) throws NdrException {
            _src.align(4);
            count = (int)_src.dec_ndr_long();
            int _sp = _src.dec_ndr_long();

            if (_sp != 0) {
                _src = _src.deferred;
                int _ss = _src.dec_ndr_long();
                int _si = _src.index;
                _src.advance(4 * _ss);

                if (s == null) {
                    if (_ss < 0 || _ss > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE );
                    s = new DfsInfo1[_ss];
                }
                _src = _src.derive(_si);
                for (int _i = 0; _i < _ss; _i++) {
                    if (s[_i] == null) {
                        s[_i] = new DfsInfo1();
                    }
                    s[_i].decode(_src);
                }
            }
        }
    }
    public static class DfsStorageInfo extends NdrObject {

        public int state;
        public String server_name;
        public String share_name;

        public void encode(NdrBuffer _dst) throws NdrException {
            _dst.align(4);
            _dst.enc_ndr_long(state);
            _dst.enc_ndr_referent(server_name, 1);
            _dst.enc_ndr_referent(share_name, 1);

            if (server_name != null) {
                _dst = _dst.deferred;
                _dst.enc_ndr_string(server_name);

            }
            if (share_name != null) {
                _dst = _dst.deferred;
                _dst.enc_ndr_string(share_name);

            }
        }
        public void decode(NdrBuffer _src) throws NdrException {
            _src.align(4);
            state = (int)_src.dec_ndr_long();
            int _server_namep = _src.dec_ndr_long();
            int _share_namep = _src.dec_ndr_long();

            if (_server_namep != 0) {
                _src = _src.deferred;
                server_name = _src.dec_ndr_string();

            }
            if (_share_namep != 0) {
                _src = _src.deferred;
                share_name = _src.dec_ndr_string();

            }
        }
    }
    public static class DfsInfo3 extends NdrObject {

        public String path;
        public String comment;
        public int state;
        public int num_stores;
        public DfsStorageInfo[] stores;

        public void encode(NdrBuffer _dst) throws NdrException {
            _dst.align(4);
            _dst.enc_ndr_referent(path, 1);
            _dst.enc_ndr_referent(comment, 1);
            _dst.enc_ndr_long(state);
            _dst.enc_ndr_long(num_stores);
            _dst.enc_ndr_referent(stores, 1);

            if (path != null) {
                _dst = _dst.deferred;
                _dst.enc_ndr_string(path);

            }
            if (comment != null) {
                _dst = _dst.deferred;
                _dst.enc_ndr_string(comment);

            }
            if (stores != null) {
                _dst = _dst.deferred;
                int _storess = num_stores;
                _dst.enc_ndr_long(_storess);
                int _storesi = _dst.index;
                _dst.advance(12 * _storess);

                _dst = _dst.derive(_storesi);
                for (int _i = 0; _i < _storess; _i++) {
                    stores[_i].encode(_dst);
                }
            }
        }
        public void decode(NdrBuffer _src) throws NdrException {
            _src.align(4);
            int _pathp = _src.dec_ndr_long();
            int _commentp = _src.dec_ndr_long();
            state = (int)_src.dec_ndr_long();
            num_stores = (int)_src.dec_ndr_long();
            int _storesp = _src.dec_ndr_long();

            if (_pathp != 0) {
                _src = _src.deferred;
                path = _src.dec_ndr_string();

            }
            if (_commentp != 0) {
                _src = _src.deferred;
                comment = _src.dec_ndr_string();

            }
            if (_storesp != 0) {
                _src = _src.deferred;
                int _storess = _src.dec_ndr_long();
                int _storesi = _src.index;
                _src.advance(12 * _storess);

                if (stores == null) {
                    if (_storess < 0 || _storess > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE );
                    stores = new DfsStorageInfo[_storess];
                }
                _src = _src.derive(_storesi);
                for (int _i = 0; _i < _storess; _i++) {
                    if (stores[_i] == null) {
                        stores[_i] = new DfsStorageInfo();
                    }
                    stores[_i].decode(_src);
                }
            }
        }
    }
    public static class DfsEnumArray3 extends NdrObject {

        public int count;
        public DfsInfo3[] s;

        public void encode(NdrBuffer _dst) throws NdrException {
            _dst.align(4);
            _dst.enc_ndr_long(count);
            _dst.enc_ndr_referent(s, 1);

            if (s != null) {
                _dst = _dst.deferred;
                int _ss = count;
                _dst.enc_ndr_long(_ss);
                int _si = _dst.index;
                _dst.advance(20 * _ss);

                _dst = _dst.derive(_si);
                for (int _i = 0; _i < _ss; _i++) {
                    s[_i].encode(_dst);
                }
            }
        }
        public void decode(NdrBuffer _src) throws NdrException {
            _src.align(4);
            count = (int)_src.dec_ndr_long();
            int _sp = _src.dec_ndr_long();

            if (_sp != 0) {
                _src = _src.deferred;
                int _ss = _src.dec_ndr_long();
                int _si = _src.index;
                _src.advance(20 * _ss);

                if (s == null) {
                    if (_ss < 0 || _ss > 0xFFFF) throw new NdrException( NdrException.INVALID_CONFORMANCE );
                    s = new DfsInfo3[_ss];
                }
                _src = _src.derive(_si);
                for (int _i = 0; _i < _ss; _i++) {
                    if (s[_i] == null) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -