~ubuntu-branches/ubuntu/natty/dnprogs/natty

« back to all changes in this revision

Viewing changes to libdap/protocol.h

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Caulfield
  • Date: 2005-10-30 15:09:21 UTC
  • Revision ID: james.westby@ubuntu.com-20051030150921-h9yn20kzxtwmjh2a
Tags: 2.32
* fal removes [] from names as they could cause confusion.
* Fixed crash in libdap if a connection gets closed more than once.
* Fix libdnet's dnet_recv to cope with 0 being returned from recvmsg.
* Some minor manpage & packaging bugs fixed.
* Include dnlogin, a replacement for sethost.
* Include libvaxdata - a library of routines for converting between VAX.
  data formats and Unix ones. Contributed by Larry Baker of the 
  US Geological Survey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 public:
17
17
    virtual bool read(dap_connection&) = 0;
18
18
    virtual bool write(dap_connection&) = 0;
 
19
    virtual ~dap_item() {}
19
20
};
20
21
 
21
22
class dap_bytes : public dap_item // number of bytes
224
225
    static const int OS_OS8     = 11;
225
226
    static const int OS_RSX11MP = 12;
226
227
    static const int OS_COPOS11 = 13;
 
228
    static const int OS_POS     = 14;
 
229
    static const int OS_VAXLELN = 15;
 
230
    static const int OS_CPM     = 16;
 
231
    static const int OS_MSDOS   = 17;
 
232
    static const int OS_ULTRIX  = 18;
 
233
    static const int OS_ULTRIX11 = 19;
 
234
    static const int OS_DTF_MVS = 21;
 
235
    static const int OS_MACOS   = 22;
 
236
    static const int OS_OS2     = 23;
 
237
    static const int OS_DTF_VM  = 24;
 
238
    static const int OS_OSF1    = 25;
 
239
    static const int OS_WIN_NT  = 26;
 
240
    static const int OS_WIN_95  = 27;
227
241
 
228
242
 private:
229
243
    dap_bytes bufsiz;
260
274
        hbk(5),
261
275
        ebk(5),
262
276
        ffb(2),
263
 
        sbn(5)
 
277
        sbn(5),
 
278
        jnl(4)
264
279
        {msg_type = ATTRIB;}
265
280
 
266
281
    virtual bool read(dap_connection&);
267
282
    virtual bool write(dap_connection&);
268
283
 
 
284
    int get_menu_bit(int);
269
285
    int get_datatype();
270
286
    int get_org();
271
287
    int get_rfm();
287
303
    int get_ebk();
288
304
    int get_ffb();
289
305
    int get_sbn();
 
306
    int get_jnl();
290
307
 
291
308
    void set_datatype(int);
292
309
    void set_org(int);
318
335
    void set_file(const char *file, bool show_dev);
319
336
    unsigned long get_size();
320
337
 
 
338
    // Bits in ATTMENU
 
339
    static const int MENU_DATATYPE = 0;
 
340
    static const int MENU_ORG = 1;
 
341
    static const int MENU_RFM = 2;
 
342
    static const int MENU_RAT = 3;
 
343
    static const int MENU_BLS = 4;
 
344
    static const int MENU_MRS = 5;
 
345
    static const int MENU_ALQ = 6;
 
346
    static const int MENU_BKS = 7;
 
347
    static const int MENU_FSZ = 8;
 
348
    static const int MENU_MRN = 9;
 
349
    static const int MENU_RUNSYS = 10;
 
350
    static const int MENU_DEQ = 11;
 
351
    static const int MENU_FOP = 12;
 
352
    static const int MENU_BSZ = 13;
 
353
    static const int MENU_DEV = 14;
 
354
    static const int MENU_SDC = 15;
 
355
    static const int MENU_LRL = 16;
 
356
    static const int MENU_HBK = 17;
 
357
    static const int MENU_EBK = 18;
 
358
    static const int MENU_FFB = 19;
 
359
    static const int MENU_SBN = 20;
 
360
    static const int MENU_JNL = 21;
 
361
 
321
362
    //DATATYPEs
322
363
    static const int ASCII      = 0;
323
364
    static const int IMAGE      = 1;
348
389
    static const int FB$PRN = 2;
349
390
    static const int FB$BLK = 3;
350
391
    static const int FB$LSA = 6;
 
392
    static const int FB$MACY11 = 7;
351
393
 
352
394
    //FOPs:
353
395
    static const int FB$RWO = 0;
354
396
    static const int FB$RWC = 1;
355
397
    static const int FB$POS = 3;
356
398
    static const int FB$DLK = 4;
 
399
    static const int FB$DIR = 5;
357
400
    static const int LOCKED = 6;
358
401
    static const int FB$CTG = 7;
359
402
    static const int FB$SUP = 8;
427
470
    dap_image ebk;
428
471
    dap_bytes ffb;
429
472
    dap_image sbn;
 
473
    dap_ex    jnl;
430
474
};
431
475
 
432
476
//ACCESS message TYPE=3
476
520
    static const int FB$TRN = 4;
477
521
    static const int FB$BIO = 5;
478
522
    static const int FB$BRO = 6;
 
523
    static const int FB$APP = 7; // FAC (Append)
 
524
    static const int FB$NIL = 7; // SHR (no access by other users)
479
525
 
480
526
    // bits for DISPLAY
481
527
    static const int DISPLAY_MAIN    = 0;
486
532
    static const int DISPLAY_PROT    = 5;
487
533
    static const int DISPLAY_ACL     = 7;
488
534
    static const int DISPLAY_NAME    = 8;
 
535
    static const int DISPLAY_3PTNAME = 9;
 
536
    static const int DISPLAY_COLLTBL = 10;
 
537
    static const int DISPLAY_CDA     = 11;
 
538
    static const int DISPLAY_TCL     = 12;
489
539
 
490
540
    // masks for DISPLAY
491
541
    static const int DISPLAY_MAIN_MASK    =   1;
496
546
    static const int DISPLAY_PROT_MASK    =  32;
497
547
    static const int DISPLAY_ACL_MASK     = 128;
498
548
    static const int DISPLAY_NAME_MASK    = 256;
 
549
    static const int DISPLAY_3PTNAME_MASK = 512;
 
550
    static const int DISPLAY_COLLTBL_MASK = 1024;
 
551
    static const int DISPLAY_CDA_MASK    = 2048;
 
552
    static const int DISPLAY_TCL_MASK    = 4096;
499
553
 
500
554
 private:
501
555
    dap_bytes accfunc;
519
573
        krf(1),
520
574
        rop(6),
521
575
        hsh(5),
522
 
        display(4)
 
576
        display(4),
 
577
        blkcnt(1),
 
578
        usz(2)
523
579
        {msg_type = CONTROL;}
524
580
 
525
581
    virtual bool read(dap_connection&);
533
589
    void set_rop_bit(int f);
534
590
    void set_rop(int f);
535
591
    void set_display(int);
 
592
    void set_blkcnt(int);
 
593
    void set_usz(int);
536
594
 
537
595
    int   get_ctlfunc();
538
596
    int   get_rac();
541
599
    bool  get_rop_bit(int f);
542
600
    int   get_display();
543
601
    unsigned long get_long_key();
 
602
    int   get_blkcnt();
 
603
    int   get_usz();
544
604
 
545
605
    // ctlfunc - Control functions:
546
606
    static const int GET            = 1;
587
647
    static const int RB$NLK  = 11;
588
648
    static const int RB$RLK  = 12;
589
649
    static const int RB$BIO  = 13;
590
 
    static const int RB$NXR  = 14;
 
650
    static const int RB$LIM  = 14;
 
651
    static const int RB$NXR  = 15;
 
652
    static const int RB$WAT  = 16;
 
653
    static const int RB$RRL  = 17;
 
654
    static const int RB$REA  = 18;
 
655
    static const int RB$KLE  = 19;
 
656
    static const int RB$KLT  = 20;
591
657
 
592
658
 private:
593
659
    dap_bytes ctlfunc;
598
664
    dap_ex    rop;
599
665
    dap_image hsh;
600
666
    dap_ex    display;
 
667
    dap_bytes blkcnt;
 
668
    dap_bytes usz;
601
669
};
602
670
 
603
671
//CONTRAN (Continue Transfer) message TYPE=5
615
683
    static const int SKIP      = 2;
616
684
    static const int ABORT     = 3;
617
685
    static const int RESUME    = 4;
 
686
    static const int TERMINATE = 5;
 
687
    static const int RESYNC    = 6;
618
688
 
619
689
    int get_confunc();
620
690
    void set_confunc(int f);
663
733
    static const int PURGE         = 3;
664
734
    static const int END_OF_STREAM = 4;
665
735
    static const int SKIP          = 5;
 
736
    static const int CHANGE_BEGIN  = 6;
 
737
    static const int CHANGE_END    = 7;
 
738
    static const int TERMINATE     = 8;
666
739
 
667
740
 private:
668
741
    dap_bytes cmpfunc;